Locked Label must have a suffix Tok

Properties
AC0021 Hidden Design Code Fix Ignore Obsolete

The Tok suffix is a naming convention that marks a label as a token — a hardcoded, non-translatable value. A locked label without the suffix looks translatable at a glance. During refactoring, someone may remove Locked = true without realizing the label holds a technical value, and its companion rule AC0020 will not catch the mistake because the name lacks the Tok marker.

Append Tok to the label name.

Example

codeunit 50100 MyCodeunit
{
    var
        ApiVersion: Label 'v1.0', Locked = true; // Locked Label must have a suffix Tok [AC0021]
}

To fix this, append Tok to the label name:

codeunit 50100 MyCodeunit
{
    var
        ApiVersionTok: Label 'v1.0', Locked = true;
}

See also

  • AC0020 - Labels suffixed with Tok must be locked
  • AC0027 - Use the ‘Tok’ suffix for token labels