RecordRef.AreFieldsLoaded(Integer,...) Method

Version: Available or changed with runtime version 6.0.

Checks whether the specified fields are all initially loaded.

Syntax

Ok :=   RecordRef.AreFieldsLoaded(Fields: Integer,...)

Parameters

RecordRef
 Type: RecordRef
An instance of the RecordRef data type.

Fields
 Type: Integer
The FieldNo's of the fields to check.

Return Value

Ok
 Type: Boolean
true if all the fields specified by the Fields parameter are currently loaded; otherwise, false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.

Remarks

This method is part of the partial records capability for improving performance. For more information, see Using Partial Records.

Example

This code example shows how you could use the AreFieldsLoaded method to determines how many fields are currently loaded for a given recordRef. Note that, because the platform might require more fields be loaded than specified by calls to SetLoadFields and AddLoadFields, the result might be larger than expected.

procedure GetLoadedFieldCount(MyRecordRef: RecordRef): Integer
var
    MyFieldRef: FieldRef;
    LoadedFields: Integer;
    Idx: Integer;
begin
    for Idx := 0 to MyRecordRef.FieldCount do begin
        MyFieldRef := MyRecordRef.FieldIndex(idx);
        if (MyFieldRef.Active() AND MyRecordRef.AreFieldsLoaded(MyFieldRef.Number)) then
            LoadedFields += 1;
    end;

    exit(LoadedFields);
end;

See Also

Using Partial Records
RecordRef Data Type
Get Started with AL
Developing Extensions