bcquality/microsoft/knowledge/style/label-suffix-approved-list.md
Jesper Schulz-Wedde b6da405376 Improve partner onboarding and documentation navigation
Lead with a complete plugin quick start and add task-oriented usage, troubleshooting, customization, and contribution guides. Preserve the broader plugin framing, correct conflicting contract guidance, support Agents folder reviews, and align repository validation. Convert existing sample references to clickable links without changing knowledge rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 17:25:29 +02:00

2 KiB

bc-version domain keywords technologies countries application-area
all
style
label
textconst
suffix
aa0074
codecop
msg
err
qst
lbl
tok
al
w1
all

Use approved suffixes on Label and TextConst names (CodeCop AA0074)

Description

CodeCop AA0074 flags Label and TextConst identifiers that do not end with an approved usage suffix. The suffix signals at the call site how the text is consumed and what translation behaviour it should get. The approved suffixes and their intended usage are: Msg for text shown via Message(); Err for text passed to Error(); Qst for text used with Confirm or StrMenu; Lbl for captions and tooltips; Tok for short tokens such as 'GET', 'PUT', 'HTTPS', GUIDs, or JSON/XML snippets that are not translated (typically with Locked = true); and Txt for general text including telemetry messages. A Label named Text000 or CannotDeleteLine without a suffix violates the rule, regardless of how readable the prose is.

Best Practice

Pick the suffix that matches the call where the label is consumed: UpdateCompleteMsg for Message(...), CustomerNotFoundErr for Error(...), DeleteRecordQst for Confirm(...), CustomerNameLbl for tooltips and captions, GetMethodTok for locked tokens, TelemetryDataTxt for telemetry payloads. Suffix choices between Tok, Lbl, Txt, and Msg are judgment calls when the suffix is valid for the usage — what matters is that the suffix is on the approved list and matches the actual call.

See sample: label-suffix-approved-list.good.al.

Anti Pattern

A Label declared with no suffix (CannotDeleteLine: Label '…';), a generic name (Text000: Label '…';), or a suffix that contradicts the usage (WrongSuffixTok: Label 'Customer %1 not found.' then passed to Error()). All three trip AA0074 or its reviewers and obscure the call-site contract.

See sample: label-suffix-approved-list.bad.al.