Labels suffixed with Tok must be locked

Properties
AC0020 Warning Design Code Fix Ignore Obsolete

The Tok suffix is a widely-adopted naming convention in Business Central AL development to mark a label as a token — a hardcoded, non-translatable value such as an API endpoint, a dictionary key, or a technical identifier. The suffix alone is a naming convention; without Locked = true, the platform still treats the label as translatable. When a label like ApiVersionTok: Label 'v1.0' goes through translation, the translated string replaces the version identifier, and every HTTP call that depends on it breaks.

Add Locked = true to every label that carries the Tok suffix. The rule also triggers when Locked is explicitly set to false.

Example

The following label is suffixed with ‘Tok’ but not locked:

codeunit 50100 MyCodeunit
{
    var
        ApiVersionTok: Label 'v1.0'; // Labels suffixed with Tok must be locked [AC0020]
}

To fix this, add Locked = true:

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

Code fix

The code fix adds Locked = true to the label declaration, or changes Locked = false to Locked = true.

See also

  • AC0021 - Locked Label must have a suffix Tok
  • AC0027 - Use the ‘Tok’ suffix for token labels