{"title":"RecordRef.AddLoadFields([Integer,...]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-addloadfields-method/","by":"JOP-AL","license":"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/recordref/recordref-addloadfields-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/recordref/recordref-addloadfields-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Specifies additional fields to be initially loaded when the record is retrieved from its data source.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"RecordRef.AddLoadFields([Integer,...]) Method","slug":"recordrefaddloadfieldsinteger-method","at":0,"chars":2138},{"level":2,"title":"Syntax","slug":"syntax","at":309,"chars":77},{"level":2,"title":"Parameters","slug":"parameters","at":386,"chars":197},{"level":2,"title":"Return Value","slug":"return-value","at":583,"chars":255},{"level":2,"title":"Remarks","slug":"remarks","at":838,"chars":585},{"level":2,"title":"Example","slug":"example","at":1423,"chars":526},{"level":2,"title":"Related information","slug":"related-information","at":1949,"chars":189}],"text":"# RecordRef.AddLoadFields([Integer,...]) Method\n> Version: _Available or changed with runtime version 6.0._\nSpecifies additional fields to be initially loaded when the record is retrieved from its data source. Subsequent calls to AddLoadFields will not overwrite fields already selected for the initial load.\n## Syntax\n```al\n[Ok := ]  RecordRef.AddLoadFields([Fields: Integer,...])\n```\n## Parameters\nRecordRef\nType: recordref-data-type\nAn instance of the recordref-data-type data type.\n*[Optional] Fields*\nType: ../integer/integer-data-type\nThe FieldNo's of the fields to be loaded.\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\ntrue 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.\n## Remarks\nCalling 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.\n> NOTE\n> 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.\nThis method is part of the partial records capability for improving performance. See Using partial records<../../devenv-partial-records>.\n## Example\nThis code example uses the AddLoadFields method to make sure that if a record is a Currency, then the Currency Factor field is loaded. This code would have to be called before a database operation is executed on the RecordRef.\n```al\nprocedure AlwaysNeededFields(VAR MyRecordRef: RecordRef)\nvar\n        Currency: Record Currency;\nbegin\nif (MyecordRef.Number = Database::Currency) then\n// We always want the Currency.\"Currency Factor\"\nMyRecordRef.AddLoadFields(Currency.FieldNo(Currency.\"Currency Factor\"));\nend;\n```\n## Related information\nUsing Partial Records<../../devenv-partial-records>\nrecordref-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}