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