{"title":"CodeCop Warning AA0448","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/codecop-aa0448/","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/analyzers/codecop-aa0448, 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/analyzers/codecop-aa0448","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":"If you want to enable your application for multilanguage functionality, you must use the FieldCaption and TableCaption methods instead of the FieldName and TableName methods.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"CodeCop Warning AA0448","slug":"codecop-warning-aa0448","at":0,"chars":1620},{"level":2,"title":"Description","slug":"description","at":147,"chars":190},{"level":2,"title":"Reason for the rule","slug":"reason-for-the-rule","at":337,"chars":468},{"level":2,"title":"Bad code example","slug":"bad-code-example","at":805,"chars":238},{"level":2,"title":"Good code example","slug":"good-code-example","at":1043,"chars":245},{"level":2,"title":"Good and bad practices for fixing the rule","slug":"good-and-bad-practices-for-fixing-the-rule","at":1288,"chars":109},{"level":2,"title":"Remarks","slug":"remarks","at":1397,"chars":86},{"level":2,"title":"Related information","slug":"related-information","at":1483,"chars":137}],"text":"# CodeCop Warning AA0448\nYou must use the FieldCaption method instead of the FieldName method and TableCaption method instead of TableName method.\n## Description\nIf you want to enable your application for multilanguage functionality, you must use the FieldCaption and TableCaption methods instead of the FieldName and TableName methods.\n## Reason for the rule\nUse the FieldCaption(Record) method and the TableCaption(Record) method whenever possible to return names of fields and tables as strings so correct translation will be automatically used. As a result user can always recognize a term that indicates a field or table name.\n> NOTE\n> The only exception to this rule is the Open(Dialog) method. In this method, you can use the field name directly. Otherwise, it can be difficult to align correctly.\n## Bad code example\n```al\ntrigger OnValidate()\nbegin\n    if \"Order Date\" > \"Starting Date\" then\n       Error(Text007, FieldName(\"Order Date\"), FieldName(\"Starting Date\"));\nend;\n\nvar\n    Text007: Label '%1 cannot be greater than %2.';\n```\n## Good code example\n```al\ntrigger OnValidate()\nbegin\n    if \"Order Date\" > \"Starting Date\" then\n       Error(Text007, FieldCaption(\"Order Date\"), FieldCaption(\"Starting Date\"));\nend;\n\nvar\n    Text007: Label '%1 cannot be greater than %2.';\n```\n## Good and bad practices for fixing the rule\nChange FieldName to FieldCaption or TableName to TableCaption.\n## Remarks\nThe Open(Dialog) method is not checked and is an exception from this rule.\n## Related information\nCodeCop Analyzer<codecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}