# Record.SetLoadFields([Any,...]) Method
> Version: _Available or changed with runtime version 6.0._
Sets the fields to be initially loaded when the record is retrieved from its data source. This will overwrite fields previously selected for initial load.
## Syntax
```al
[Ok := ]  Record.SetLoadFields([Fields: Any,...])
```
## Parameters
Record
Type: record-data-type
An instance of the record-data-type data type.
*[Optional] Fields*
Type: ../any/any-data-type
The FieldNo's of the fields to be loaded.
## Return Value
*[Optional] Ok*
Type: ../boolean/boolean-data-type
true if all fields are selected for subsequent loads; otherwise, false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.
## Remarks
Calling SetLoadFields on a record without passing any fields will reset the fields selected to load to the default, where all readable normal fields are selected for load.
It is not necessary to include the following fields, because they are always selected for loading: Primary key, SystemId, and data audit fields (SystemCreatedAt, SystemCreatedBy, SystemModifiedAt, SystemModifiedBy).
Depending on the runtime version, the runtime may require extra fields to be selected for loading. Which extra fields to specify depends on the state of the record and table or table extension definition. For example, fields that are filtered upon are always loaded.
> NOTE
> Only fields of `FieldClass = Normal` are supported as input values for the Fields parameter. If fields of `FieldClass = FlowFilter` or `FieldClass = FlowField` are passed, the return value will be false if observed; otherwise, a runtime error will occur.
This method is part of the partial records capability for improving performance. See Using partial records<../../devenv-partial-records>.
## Example
This example uses the SetLoadFields method to speedup the calculation of the mean for values of the Standard Cost field in the Item table. Instead of loading all fields, only the Standard Cost is loaded. The other fields aren't needed for the calculation, so they're not loaded.
```al
procedure ComputeArithmeticMean(): Decimal
var
    Item: Record Item;
    SumTotal: Decimal;
    Counter: Integer;
begin
    Item.SetLoadFields(Item."Standard Cost");
    if Item.FindSet() then begin
        repeat
            SumTotal += Item."Standard Cost";
            Counter += 1;
        until Item.Next() = 0;
        exit(SumTotal / Counter);
    end;
end;
```
## Related information
Using Partial Records<../../devenv-partial-records>
record-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-setloadfields-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/record/record-setloadfields-method/
