Skip to main content
A sales rule validates an item on a sales document. If its condition fails, the rule either blocks the write or warns and allows the user to acknowledge the warning. Rules apply to quote lines, lines, and sales invoice lines. For example, to restrict an export-controlled part, scope the rule to its item group, enable all three document types, and require 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), or none (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’s transaction.quantity.
  • Operator: such as eq, neq, in, notIn, isSet, isNotSet, gt and lt; the builder offers the operators each field allows.
The message shown on a violation supports tokens like `{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.
The ship-to that country rules evaluate is where the goods actually go: a overrides the order header’s address, an invoice line converted from a sales order resolves its destination through that order, and a standalone invoice line uses the invoice’s own “Ship To”.

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.
Unlike storage rules, sales rules always target items — there is no work-center target.

Rule fields

Where to manage them

Sales rules live in the Sales area, under Sales Rules. Create, edit, and toggle them there. To attach an existing rule to a single item, use the Sales rules card on the item’s Sales tab.