{"title":"FieldRef.Active() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/fieldref/fieldref-active-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/fieldref/fieldref-active-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/fieldref/fieldref-active-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 field that is currently selected is enabled.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":124,"chars":112},{"level":2,"title":"Parameters","slug":"parameters","at":236,"chars":97},{"level":2,"title":"Return Value","slug":"return-value","at":333,"chars":54},{"level":2,"title":"Remarks","slug":"remarks","at":387,"chars":232},{"level":2,"title":"Example","slug":"example","at":619,"chars":1350},{"level":2,"title":"Related information","slug":"related-information","at":1969,"chars":136}],"text":"> Version: _Available or changed with runtime version 1.0._\nChecks whether the field that is currently selected is enabled.\n## Syntax\n```al\nOk :=   FieldRef.Active()\n```\n> NOTE\n> This method can be invoked using property access syntax.\n## Parameters\nFieldRef\nType: fieldref-data-type\nAn instance of the fieldref-data-type data type.\n## Return Value\nOk\nType: ../boolean/boolean-data-type\n## Remarks\nEach field in a record can be set as enabled or disabled in the table description. You cannot use a disabled field because disabled fields cannot contain data.\nThis method is like the ../record/record-fieldactive-method.\n## Example\nThe following example opens table 18 \\(Customer\\) as a RecordRef variable that is named Recref. The ../recordref/recordref-field-method uses Recref to create a FieldRef variable that is named MyFieldRef. MyFieldRef sets a reference to the first field \\(field 1\\) in the table. The fieldref-setrange-method sets a filter that selects record 30000. The ../recordref/recordref-field-method selects the record and then loops through fields 1 through 6. For each field, the Active method determines whether the field is enabled. If the field is enabled, a message that states that the field is enabled is displayed. Otherwise, a message that states that the field is not enabled is displayed.\n> NOTE\n> You can use the name of the table instead of the table number to open the table by using the following syntax:\n```al\nRecRef.Open(DATABASE::Customer)\n```\n```al\nvar\n    Recref: RecordRef;\n    MyFieldRef: FieldRef;\n    i: Integer;\n    Text000: Label 'Field %1 is enabled.';\n    Text001: Label 'Field %1 is not enabled.';\nbegin\n    Recref.Open(18);\n    MyFieldRef := Recref.Field(1);\n    MyFieldRef.SetRange('30000');\n    Recref.Find('-');\n    for i := 1 to 5 do begin\n      MyFieldRef := Recref.FieldIndex(i);\n      if MyFieldRef.Active then\n        Message(Text000, i)\n      else begin\n        Message(Text001, i)\n      end;\n    end;\nend;\n\n```\n## Related information\nfieldref-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}