{"title":"Record.FieldName(Any) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/record/record-fieldname-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/record/record-fieldname-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/record/record-fieldname-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":"Gets the name of a field as a string.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Record.FieldName(Any) Method","slug":"recordfieldnameany-method","at":0,"chars":1025},{"level":2,"title":"Syntax","slug":"syntax","at":129,"chars":59},{"level":2,"title":"Parameters","slug":"parameters","at":188,"chars":161},{"level":2,"title":"Return Value","slug":"return-value","at":349,"chars":50},{"level":2,"title":"Remarks","slug":"remarks","at":399,"chars":246},{"level":2,"title":"Example","slug":"example","at":645,"chars":246},{"level":2,"title":"Related information","slug":"related-information","at":891,"chars":134}],"text":"# Record.FieldName(Any) Method\n> Version: _Available or changed with runtime version 1.0._\nGets the name of a field as a string.\n## Syntax\n```al\nName :=   Record.FieldName(Field: Any)\n```\n## Parameters\nRecord\nType: record-data-type\nAn instance of the record-data-type data type.\nField\nType: ../any/any-data-type\nThe name of the field in the record.\n## Return Value\nName\nType: ../text/text-data-type\n## Remarks\nThe advantage of using the FieldName method call instead of a static assignment, like NameOfField := 'MyField', is that using the FieldName method dynamically adapts to any change to the field name made in the development environment.\n## Example\nThe following example gets the name of the No. field in the Customer table, and stores it in a string.\n```al\nvar\n    NameOfField: Text;\n    CustomerRec: Record Customer;\n\nbegin\n    NameOfField := CustomerRec.FieldName(\"No.\");\nend;\n```\n## Related information\nrecord-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}