Editar

Compartilhar via


Record.AreFieldsLoaded(Any,...) Method

Version: Available or changed with runtime version 6.0.

Checks whether the specified fields are all initially loaded.

Syntax

Ok :=   Record.AreFieldsLoaded(Fields: Any,...)

Parameters

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

Fields
 Type: Any
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 example shows how to use the AreFieldsLoaded method when you only need to load either the Name or the Name 2 field on the Customer table. The procedure selects which ever field is actually loaded. If neither is loaded, this causes a JIT load.

procedure GetLoadedName(Cust: Record Customer): Text 
begin 
    if Cust.AreFieldsLoaded(Cust.Name) then 
        exit(Cust.Name) 
    else 
        if Cust.AreFieldsLoaded(Cust."Name 2") then 
            exit(Cust."Name 2") 
        else 
            exit(Cust.Name);
end;

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