Click or drag to resize
RunLoadRecords Method (Int64, XFieldDefMap, XWhere, XOrderBy, Int32)
Loads records .

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static XRecordMap LoadRecords(
	long p_TableKey,
	XFieldDefMap p_FieldDefMap,
	XWhere p_Where,
	XOrderBy p_OrderBy = null,
	int p_Limit = 0
)

Parameters

p_TableKey
Type: SystemInt64
The table key.
p_FieldDefMap
Type: Biolomics.BioCallbackXFieldDefMap
The FieldDefMap containing a list of FieldDef to be loaded in loaded records.
p_Where
Type: Biolomics.SharedClassesXWhere
The XWhere statement.
p_OrderBy (Optional)
Type: Biolomics.SharedClassesXOrderBy
[Optional]The OrderBy statement.
p_Limit (Optional)
Type: SystemInt32
[Optional]The limit of loaded records.

Return Value

Type: XRecordMap
List of loaded records.
Examples
Each record header contains some information, like the record name, creation date, lat modification date, owner name. The last field is called "Details" and can contain any information. The example below will set the Details field.
Example VB.Net
Imports System
Imports BioloMICS.BioCallback
Imports BioloMICS.SharedClasses

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim c As New Program
        c.ChangeRecordDetails()
    End Sub

    '    Write sub functions here
    Public Sub ChangeRecordDetails()
        '    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
        '    load all records
        Dim Where As XWhere = XWhere.All
        '    use an empty FieldDefMap
        Dim FieldDefMap As New XFieldDefMap
        '    load the records
        Dim RecordMap As XRecordMap = Run.LoadRecords(TableDef.Key, FieldDefMap, Where)

        For Each Record As XRecord In RecordMap
            '    change the record details, located in the record header
            Record.Details = "This is record #" & Record.Id.ToString
            Record.Save(False)
        Next

        '    load the records second methode
        Dim newRecordMap As New XRecordMap
        Run.LoadRecords(newRecordMap, TableDef.Key, FieldDefMap, Where)

        For Each Record As XRecord In newRecordMap
            '    change the record details, located in the record header empty string instead of old value
            Record.Details = String.Empty
            Record.Save(False)
        Next

    End Sub

End Class
See Also