title | description | ms.author | ms.date | ms.topic | author | ms.reviewer |
---|---|---|---|---|---|---|
RecordRef.AreFieldsLoaded(Integer,...) Method |
Checks whether the specified fields are all initially loaded. |
solsen |
05/14/2024 |
reference |
SusanneWindfeldPedersen |
solsen |
Version: Available or changed with runtime version 6.0.
Checks whether the specified fields are all initially loaded.
Ok := RecordRef.AreFieldsLoaded(Fields: Integer,...)
RecordRef
Type: RecordRef
An instance of the RecordRef data type.
Fields
Type: Integer
The FieldNo's of the fields to check.
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.
This method is part of the partial records capability for improving performance. For more information, see Using Partial Records.
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;
Using Partial Records
RecordRef Data Type
Get Started with AL
Developing Extensions