RunMaxRecordId Method |
Namespace: Biolomics.BioCallback
Imports System Imports BioloMICS.BioCallback Imports BioloMICS.SharedClasses Public Class Program <STAThread()> Shared Sub Main() Dim program As New Program program.Test() End Sub ' Write sub functions here Public Sub Test() ' get the current connection Dim SqlCo As XConnection = Run.GetCurrentConnection() If SqlCo Is Nothing Then Return End If ' get the current layout Dim Layout As XDataLayout = Run.GetCurrentLayout() If Layout Is Nothing Then ' no current layout in a search page Return End If ' get the current table Dim TableDef As XTableDef = SqlCo.GetTableDef(Layout.TableKey) If TableDef Is Nothing Then ' should never happen Return End If ' get the max record ID of all records with a name starting with "candida" Dim MaxId As Integer = Run.MaxRecordId(TableDef.Key, XWhere.StartWith("Name", "candida")) ' write the result Console.Write("Name of record #" & MaxId.ToString & " starts with 'candida'") End Sub End Class