Customer-Specific Item Warning + Recommended Substitute
A Business Central AL extension that shows a warning when a user adds a specific item for a specific customer on a Sales Order line, and suggests a substitute item (warning-only, not a hard block).
Summary
Business Impact
Gallery
Screenshots and artifacts from the build (sanitized where needed).
I created a custom table to store rules (customer + not recommended item + recommended item + warning message + enabled), and a list page so rules can be maintained directly inside Business Central.
An event subscriber runs when an item is entered on a Sales Order line. It checks for a matching rule and shows a warning popup. This is warning-only—users can still proceed when exceptions are needed.
Packaged the extension into an .app and published it successfully. I verified deployment by searching for “Customer Item Rules” in Business Central and confirming the new page appeared in Administration.
Created a sample rule record (Enabled = true), then tested on a Sales Order for the target customer. When the restricted item was added, the warning popup displayed the configured message and substitute item number.
- CustomerItemRule.Table.al — stores rules (customer, item, recommended item, message, enabled, optional dates)
- CustomerItemRules.Page.al — list page to maintain rules
- CustomerItemRuleSubscriber.Codeunit.al — subscriber checks rule and shows warning
- CustomerItemRules.PermissionSet.al — permissions for maintaining rules