From 937be2ffed81f15bfebba8be81df1ad9e7d5408f Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Wed, 19 Aug 2026 11:24:54 +0200 Subject: [PATCH] docs(PC0021, LC0054): document AppSource mandatory affix handling - PC0021: new section explaining affix stripping for table extension fields (ALCops/Analyzers#436), including the own-table exception. - LC0054: mention mandatorySuffix and the loose leading-affix semantics after the refactor onto the shared MandatoryAffixes helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- content/docs/analyzers/LinterCop/LC0054.md | 2 +- content/docs/analyzers/PlatformCop/PC0021.md | 26 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/content/docs/analyzers/LinterCop/LC0054.md b/content/docs/analyzers/LinterCop/LC0054.md index 8b12f58..f06d3ec 100644 --- a/content/docs/analyzers/LinterCop/LC0054.md +++ b/content/docs/analyzers/LinterCop/LC0054.md @@ -30,7 +30,7 @@ interface IPaymentProcessor ### Prefixes -Setting `mandatoryAffixes` or `mandatoryPrefix` in the `AppSourceCop.json` file enables this rule to handle prefixes. The AppSourceCop analyzer itself does not need to be activated — the configuration file is used solely to retrieve affixes, preventing duplicate setup for AppSource development scenarios. +Setting `mandatoryAffixes`, `mandatoryPrefix`, or `mandatorySuffix` in the `AppSourceCop.json` file enables this rule to handle prefixes. Every configured value is accepted as a leading affix, matching the loose semantics of AppSourceCop itself. The AppSourceCop analyzer does not need to be activated — the configuration file is used solely to retrieve affixes, preventing duplicate setup for AppSource development scenarios. {{< highlight al "hl_lines=1" >}} interface "ABC ISubscriber" diff --git a/content/docs/analyzers/PlatformCop/PC0021.md b/content/docs/analyzers/PlatformCop/PC0021.md index 6cb3122..d4b4c6f 100644 --- a/content/docs/analyzers/PlatformCop/PC0021.md +++ b/content/docs/analyzers/PlatformCop/PC0021.md @@ -99,6 +99,32 @@ table 50101 "Posted Sales Document" } {{< /highlight >}} +### Mandatory affixes + +When `mandatoryPrefix`, `mandatorySuffix`, or `mandatoryAffixes` are configured in `AppSourceCop.json`, field names on your own table extensions must carry an affix — forcing them to differ from a paired base-table field. This rule strips those affixes before comparing names, so a compliant extension field does not trigger a false positive. The AppSourceCop analyzer itself does not need to be activated — the configuration file is used solely to retrieve affixes. + +{{< highlight al >}} +tableextension 50100 "ABC Sales Document" extends "Sales Document" +{ + fields + { + field(50100; "ABC Discount Amount"; Decimal) { } + } +} + +tableextension 50101 "ABC Posted Sales Document" extends "Posted Sales Document" +{ + fields + { + field(50100; "ABC Discount Amount"; Decimal) { } + } +} +{{< /highlight >}} + +With `"mandatoryPrefix": "ABC "` configured, the names are compared without the affix and no diagnostic is reported. + +Affix stripping applies only to fields declared on table extensions in your own app. Fields on your own tables are not stripped: there the affix belongs on the table object, not on each field. + ### See also - [PC0020](pc0020/) — Incompatible field types across TransferFields