Skip to content
  • There are no suggestions because the search field is empty.

CSM Channel Orders - Sales Operation Rules

Guardrails that stop CSM automation from creating, releasing, or posting a Business Central document — or sending a shipment line to a channel — when a condition you care about is met.

 

Overview

CSM automation can create, release, and post Business Central documents without anyone looking at them. Sales Operation Rules are the check that runs first.

Each rule names a condition. When the rule is enabled and its condition is met, CSM stops that automation step, writes the reason into the order's Status Text, and leaves the order for someone to review. It is not an error — the order simply waits.

Sales Operation Rules govern what CSM does on its own. They never block a user from manually releasing or posting a document in Business Central.

 

What Happens With No Rules

If no rule exists, or no matching rule is enabled, the action is allowed. Automation is permissive by default. Rules only ever take capability away.

Because every shipped rule is a "deny" condition, in practice Enabled means the rule is active and will block when its condition is met.

 

Loading the Default Rules

Rules are not created when CSM is installed. Load them once:

  • Search for CSM Setup and select the related link
    • Choose Related › CSM Sales Operation Rules
    • Choose Load Default Rules

Nine rules are created for all sales channels, all disabled. Enable the ones you want. Re-running it resets the nine default rules to their shipped state, including setting Enabled back to off. Run it once when setting up, not as a repair step.

 

The Default Rule

Rule Code Blocks When
SO-UNBALANCED-R Release of the sales order The channel order total does not match the Business Central document total.
SO-UNBALANCED-P Posting of the sales order
CR-UNBALANCED-R Release of the credit memo
CR-UNBALANCED-P Posting of the credit memo
SO-INVENTORY-R Release of the sales order Any line item has insufficient inventory for the ordered quantity.
SO-INVENTORY-P Posting of the sales order
SO-HIGHRISKORDER-C Creation of the sales order The order's Order Risk is High. Medium and Low do not trigger it.
SO-HIGHRISKORDER-R Release of the sales order
SO-HIGHRISKORDER-P Posting of the sales order

Note: The high-risk rules depend on Order Risk being populated, which requires a channel that supplies risk scoring and the Retrieve Order Risk Info action or its automation.

Channel-seeded Rules

Rule Code Blocks When
SH-SKIPZEROLINE Sending a shipment line to Shopify The shipment line quantity is zero. Created automatically and enabled on every Shopify sales channel.

B2B Name Synchronization Rules

Two further rule codes are recognized but are not created by Load Default Rules. Enter them by hand if you need them.

Rule Code Suppresses
B2B-S-COMP-NAME Copying the Business Central customer's name onto the CSM Company when synchronizing from Business Central.
B2B-U-COMP-NAME Copying the CSM Company's name onto the Business Central customer when synchronizing to Business Central.

They are evaluated directly by the B2B company code rather than by the rule engine, so only Rule Code, Sales Channel Code, and Enabled matter. The processing action, document type, and function name are ignored — leave them at their defaults.

 

Enabling and Scoping a Rule

Open CSM Sales Operation Rules, then set:

Field Purpose
Enabled Turns the rule on. Off means the engine ignores it entirely.
Sales Channel Code Leave blank to apply the rule to every sales channel. Enter a code to scope it to one channel.
Rule Code The rule's identifier. Unique per sales channel.
Description What the rule does, shown in the list.
Order Processing Action Create, Release, Post, or Send Shipment Line To Channel.
BC Document Type Order or Credit Memo.
Sales Operation Rule Evaluator The codeunit holding the rule's logic. Ships with one: CSM Sales Operation Rules Mgt.
Action Processing Func. Name The named check inside the evaluator. Use the lookup — an unregistered name is rejected.
Note Free text for your own documentation.

Applying One Rule to Some Channels but not Others

There is no multi-channel selection. Create one rule line per channel, each with the same Rule Code and a different Sales Channel Code.

Every enabled rule matching the channel or blank is evaluated, and the first one that denies wins. A blank-channel rule will still block a specific channel even if you added a channel-specific rule alongside it. To exempt a channel from a global rule, scope the rule to the channels that need it instead of leaving it blank.

 

Available Checks

The Action Processing Func. Name is the actual logic. These ship in the default evaluator:

Function Denies when Message written to Status Text
DENYUNBALANCED Channel total does not equal the Business Central document total Document not released, total does not match Channel total.
DENYITEMUNAVAILABLE Any order item has insufficient inventory. Skipped for credit memos. Document not released due to insufficient inventory
DENYHIGHRISK Order Risk is High The order <Order ID> has been flagged as high risk.
DENYSENDSHIPMENTLINEZEROQTY The shipment line quantity is zero Shipment Line Quantity is zero.
X Never — an explicit no-op —

To see the registered functions and their descriptions, open CSM Setup › Related › CSM Sales Operation Rule Functions. The Register Functions for Rule Evaluator action refreshes the list from the selected evaluator codeunit.

 

Custom Rules

The evaluator is extensible. A partner or developer can add a codeunit containing company-specific checks, register it as a new Sales Operation Rule Evaluator, and its functions become selectable on the rule line.

A typical example: a custom Approval Code field on the sales order, with a function that denies posting whenever that field is blank.

Once registered, a custom rule is set up exactly like a default one — choose the evaluator, choose the function, set the action and document type, and enable it.

 

Overlap With the Unbalanced Channel Settings

The sales channel also carries Deny Unbalanced Auto Release and Deny Unbalanced Auto Post. These perform the same total check as the UNBALANCED rules and are evaluated immediately after them, so the two mechanisms are redundant.

Tell them apart by the message in Status Text:

  • A rule writes Document not released, total does not match Channel total.
  • The channel setting writes Sales Order not released, total does not match Channel Order total.

Pick one mechanism. Using both means disabling a rule has no effect while the channel setting is still on.

 

Troubleshooting

Symptom Cause and fix
An order stopped and Status Text names a rule reason Working as intended. Fix the underlying condition, then run Update Status or release the document manually.
A rule is enabled but never fires Check the Order Processing Action and BC Document Type match the step you expect, and that the Sales Channel Code is blank or matches the order's channel.
Disabling a rule did not unblock the order The channel's Deny Unbalanced Auto Release or Auto Post setting may be doing it instead. Compare the Status Text wording.
Rules reverted to disabled Load Default Rules was run again. Re-enable them.
High-risk rule never fires Order Risk is Not Assessed. The channel must supply risk data and the retrieval must be running.
The list is empty Default rules are not created on install. Run Load Default Rules.