customer.location.countryCode notIn the restricted-country list. Set severity to error and the message to `{item.id}` cannot ship to this destination. A matching line is then rejected with that message.
What a rule checks
Each rule holds a small condition tree, a match kind over one or more field/operator/value rows:- Match kind:
all(every condition must hold),any(at least one), ornone(none may hold). - Field: chosen from a fixed registry: item facts (
item.type,item.replenishmentSystem,item.itemTrackingType, item custom fields), customer facts (customer.customerTypeId,customer.customerStatusId, customer custom fields), the document’s ship-to country (customer.location.countryCode), and the line’stransaction.quantity. - Operator: such as
eq,neq,in,notIn,isSet,isNotSet,gtandlt; the builder offers the operators each field allows.
`{item.id}` and
`{customer.location.countryCode}`, so the text can name the offending line. The rule “passes” when its
conditions hold; a violation fires when they don’t.
Where rules fire
A rule lists the surfaces (sales-document line types) it applies to:quoteLine, salesOrderLine, and
salesInvoiceLine. Two kinds of checkpoint run them:
- Line checks as a line is created or edited on a quote, sales order, or sales invoice.
- Document gates at each commitment point: finalizing a quote, converting a quote to an order (or an RFQ to a quote), confirming a sales order, posting its shipment, and posting a sales invoice. The gate re-reads every line on the document, so it also catches staleness — a rule authored after the line was written, or a ship-to that changed.
Block or warn
Both outcomes leave a trail: a blocked write and an acknowledged warning are each recorded as evidence
(rule, document, line, item, who, when), and the people in the sales rule notification group
(Settings → Sales) are notified by email.
Scope and assignment
A rule reaches the lines it applies to in one of two ways:- By filter: scope to item types and/or item groups, combined with OR or AND. An empty filter matches every item.
- By assignment: pin a rule to a specific item from the Sales rules card on that item’s Sales tab.