Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/analyzers/LinterCop/LC0054.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
26 changes: 26 additions & 0 deletions content/docs/analyzers/PlatformCop/PC0021.md
Original file line number Diff line number Diff line change
Expand Up @@ -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