{"title":"RecordRef.AreFieldsLoaded(Integer,...) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-arefieldsloaded-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-arefieldsloaded-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-arefieldsloaded-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":"Checks whether the specified fields are all initially loaded.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"RecordRef.AreFieldsLoaded(Integer,...) Method","slug":"recordrefarefieldsloadedinteger-method","at":0,"chars":1770},{"level":2,"title":"Syntax","slug":"syntax","at":170,"chars":75},{"level":2,"title":"Parameters","slug":"parameters","at":245,"chars":180},{"level":2,"title":"Return Value","slug":"return-value","at":425,"chars":267},{"level":2,"title":"Remarks","slug":"remarks","at":692,"chars":149},{"level":2,"title":"Example","slug":"example","at":841,"chars":740},{"level":2,"title":"Related information","slug":"related-information","at":1581,"chars":189}],"text":"# RecordRef.AreFieldsLoaded(Integer,...) Method\n> Version: _Available or changed with runtime version 6.0._\nChecks whether the specified fields are all initially loaded.\n## Syntax\n```al\nOk :=   RecordRef.AreFieldsLoaded(Fields: Integer,...)\n```\n## Parameters\nRecordRef\nType: recordref-data-type\nAn instance of the recordref-data-type data type.\nFields\nType: ../integer/integer-data-type\nThe FieldNo's of the fields to check.\n## Return Value\nOk\nType: ../boolean/boolean-data-type\ntrue 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.\n## Remarks\nThis method is part of the partial records capability for improving performance. See Using Partial Records<../../devenv-partial-records>.\n## Example\nThis 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.\n```al\nprocedure GetLoadedFieldCount(MyRecordRef: RecordRef): Integer\nvar\n    MyFieldRef: FieldRef;\n    LoadedFields: Integer;\n    Idx: Integer;\nbegin\n    for Idx := 0 to MyRecordRef.FieldCount do begin\n        MyFieldRef := MyRecordRef.FieldIndex(idx);\n        if (MyFieldRef.Active() AND MyRecordRef.AreFieldsLoaded(MyFieldRef.Number)) then\n            LoadedFields += 1;\n    end;\n\n    exit(LoadedFields);\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>"}