RunCompileRecordIdList Method |
Namespace: Biolomics.BioCallback
public static int CompileRecordIdList( XWhere p_Where, string p_TableName, List<string> p_FieldNames, string p_NewRecordName )
Imports System Imports BioloMICS.BioCallback Imports BioloMICS.SharedClasses Imports Biolomics.Utility.DatabaseConstants Imports System.Collections Public Class Program <STAThread()> Shared Sub Main() Dim program As New Program program.CompileREcordIdList() End Sub ' Write sub functions here Public Sub CompileREcordIdList() ' get the current connection Dim SqlCo As XConnection = Run.GetCurrentConnection() If SqlCo Is Nothing Then Return End If ' get the current layout Dim CurrentLayout As XDataLayout = Run.GetCurrentLayout() If CurrentLayout Is Nothing Then Return End If ' get the current table displayed in that layout Dim TableDef As XTableDef = SqlCo.GetTableDef(CurrentLayout.TableKey) If TableDef Is Nothing Then Return End If ' load all records Dim Where As XWhere = XWhere.Lte(StaticFields.id, 8) Dim fieldnames As New Generic.List(Of String) fieldnames.Add("Sequence") fieldnames.Add("Country") Dim newrecordName As String = "New Compiled record" 'run compilerecordidlist run.CompileRecordIdList(Where, TableDef.UserName, fieldnames, newrecordName) 'draw error messages if exists DrawMessages() End Sub ' display all recent error messages Public Sub DrawMessages() Dim ErrorList As Generic.List(Of String) = Run.GetLastErrorMessage() For Each errorMsg As String In ErrorList Console.Write(vbcrlf & errorMsg) Next End Sub End Class