Inbound order policy evaluation
What it does. Checks each new sales order in a legal entity against the inbound order policy: an order with a line priced outside the tolerance is held or flagged, and a hold-free order is confirmed automatically when you allow it. It also takes on orders whose price hold someone cleared. Runs: when you schedule it as a batch job, once in each legal entity where the policy is on. Who looks after it: Integration administrator.
Purpose
Orders that arrive without a person looking at them can carry a price far from the item's sales price, through a mapping error, a stale price list or a typing mistake in the source system. The policy stops such an order before it is confirmed, and confirms the clean ones so nobody has to.
Switching the policy on only marks new orders as waiting for evaluation. This job does the checking, holding and confirming. Without it, every order stays Pending: none is held, none is confirmed automatically, and the Inbound orders on hold tile stays at zero.
When it runs
- Only when you schedule it (or run it from its menu item). There is no background process for it.
- A run works in the legal entity it runs in, and only there. Schedule one job in each legal entity where the policy is on.
- It evaluates the orders that are Pending or Released at the moment the run starts. An order created during a run waits for the next one.
- Orders get a policy state row when they are created while the policy is on in their legal entity. That is every new sales order in the legal entity, whatever created it (an integration, a person, a data import or another process), not only orders from an integration. Orders created while the policy was off are never evaluated.
Configuration and scheduling
The policy settings are on System administration > Setup > Lattice > Inbound order policy parameters, per legal entity:
| Tab | Field | Default | Effect on the job |
|---|---|---|---|
| Policy | Inbound order policy enabled | No | Off: new orders get no state row, and a run stops at once |
| Price tolerance | Price tolerance (%) | 0 | 0 means no price check |
| Price tolerance | Price hold reason | Blank | Fixed text for Hold reason; blank records which line breached |
| Price tolerance | Price hold code | Blank | The standard order hold code placed on a breaching order; blank means the order is only flagged |
| Confirmation | Auto-confirm hold-free orders | No | Yes: orders without a breach are confirmed by the job |
| Confirmation | Post-confirmation edit lock (minutes) | 0 | Minutes after an automatic confirmation during which the order's lines cannot be changed; 0 means no lock |
On the Customers tab, a row with Enabled selected replaces Price tolerance (%), Price hold reason, Price hold code, Auto-confirm hold-free orders and Post-confirmation edit lock (minutes) for that customer's orders. The policy switch itself stays the legal entity's.
To schedule the job:
- Switch to the legal entity the job should run for.
- Go to System administration > Periodic tasks > Lattice > Inbound order policy evaluation (also the Inbound order policy evaluation button on Inbound order policy state).
- The dialog has no fields of its own. Expand Run in the background and set Batch processing to Yes.
- Enter a Task description you will recognize, and a Batch group if your environment uses them.
- Select Recurrence and set the interval. Choose it as the longest delay you accept between an order arriving and its hold or confirmation: until the next run the order is Pending, neither held nor confirmed. Every few minutes is typical. Select OK.
- Select OK to create the batch job.
- Repeat in each legal entity where the policy is on. One recurring job per legal entity is enough.
With Batch processing left at No, the job runs once, now, while you wait.
How it works
- A run reads Inbound order policy enabled in its legal entity. When it is No, the run logs "Inbound order policy is disabled; evaluation batch skipped." and stops.
- It lists every order whose Policy status is Pending or Released, then handles them one at a time.
- For a Pending order, it takes the legal entity's settings, or the customer's row when one is enabled.
- When Price tolerance (%) is above 0, it compares each line that has an item with the item's sales price on the released product. A line whose item has no sales price (0) is not checked. The first line that deviates by more than the tolerance, up or down, is a breach.
- On a breach, the hold reason is Price hold reason, or when that is blank, "Line %1 (item %2) sales price %3
deviates from the item base price %4 beyond the configured tolerance." with the values filled in. Then:
- With a Price hold code, and the standard order hold available (below), the job places a standard order hold with that code (never a second active one with the same code). The Policy status becomes Held, On policy hold is Yes and Standard hold code shows the code.
- Otherwise no hold is placed and nothing stops the order. The Policy status becomes Flagged for someone to review.
- Without a breach, when Auto-confirm hold-free orders is Yes, the order has no active standard order hold of any kind, has no confirmation yet and has at least one line, the job confirms it through the Lattice sales order confirmation operation, as the user the batch job runs as. When that succeeds, the Policy status becomes Auto-confirmed, and when Post-confirmation edit lock (minutes) is above 0, Edit-locked until is set that many minutes ahead.
- In every other case (auto-confirm off, another hold on the order, already confirmed, no lines, or the confirmation refused) the Policy status becomes Processed and the order is left for you.
- When someone clears or removes the policy's price hold on the standard Order holds page, the order becomes Released at once (clearing a different hold does not release it). The next run takes a Released order on without checking the price again: it is confirmed and becomes Auto-confirmed under the same conditions as step 6, or becomes Processed. Hold reason and Standard hold code stay on the row as a record.
- At the end the run logs "Inbound order policy evaluation completed. Orders processed: %1." with the count.
Evaluated records when the job last wrote each row. Flagged, Processed and Auto-confirmed are final: the job does not look at those orders again.
Before it can run
- Inbound order policy enabled is Yes in the legal entity, and the job is scheduled from that legal entity. Turning the policy on where the job is not scheduled (waiting, ready or running) in that legal entity shows a warning on Inbound order policy parameters: "The policy is on, but Inbound order policy evaluation is not scheduled in this legal entity, so no order is evaluated. Schedule it in System administration > Periodic tasks."
- The batch service is running.
- For holds: a Price hold code, the Order hold configuration key, and the feature (Preview) Advanced Order Hold status change enabled in Feature management. Without them breaching orders are only flagged.
- For automatic confirmation: the user the batch job runs as must be able to confirm the legal entity's sales orders.
- The license does not stop a scheduled run. Started from the menu item while the license blocks Lattice, the job shows a license warning and does nothing.
Inputs and outputs
| Reads | Writes |
|---|---|
| Inbound order policy parameters and its Customers rows | Policy status, On policy hold, Hold reason, Standard hold code, Edit-locked until and Evaluated on Inbound order policy state |
| The order's lines and each item's sales price on the released product | A standard order hold with the Price hold code, on breaching orders |
| Active standard order holds and existing confirmations of the order | A sales order confirmation, for orders it confirms (with its confirmation number) |
An automatic confirmation goes through the Lattice confirmation operation, so it is recorded like a call from an
integration: in the service call log as MGCLatticeSalesOrderPostingService.confirmSalesOrder (as far as
Service operation logging configuration keeps rows for that operation) and in the idempotency log.
Monitoring and logs
- System administration > Inquiries > Lattice > Integration operations > Inbound order policy state: one row per order with its Policy status. Filter on Pending to see what waits for the next run, and on Flagged for orders to review.
- The Inbound orders on hold tile on the Integration operations workspace counts the orders that are Held. Flagged orders are not counted.
- System administration > Inquiries > Batch jobs: the job's history and log hold the messages from How it works.
When it fails
A failure on one order does not stop the run. The run logs "Inbound order policy evaluation failed for order %1." with the order number and goes on with the next order. That order keeps its status and is tried again by the next run.
| Symptom | Cause | Fix |
|---|---|---|
| Orders stay Pending | The job is not scheduled in that legal entity, or the batch service is stopped | Schedule the job from that legal entity and check it on Batch jobs |
| The log says "Inbound order policy is disabled; evaluation batch skipped." | The switch is off in the legal entity the job runs in | Switch it on, or schedule the job in the right legal entity |
| A new order has no row on Inbound order policy state | The policy was off when the order was created | Expected: such orders are never evaluated. Check and confirm them yourself |
| A breaching order is Flagged, not Held | No Price hold code, the order hold feature or configuration key is off, or the hold could not be placed | Set the code and enable the feature for future orders. Review and confirm the flagged order yourself: it is not evaluated again |
| An order is Processed although Auto-confirm hold-free orders is Yes | Another standard order hold is active, the order was already confirmed or had no lines, or the confirmation was refused | Read the confirmSalesOrder call for the order in the service call log, fix the cause and confirm the order yourself |
| The log says "Inbound order policy evaluation failed for order %1." | An unexpected error while evaluating that order | Read the messages around it in the job's log. The order is tried again by the next run |
| A user or an integration cannot change an order's lines: "Sales order %1 is within its post-confirmation edit-lock window; its lines cannot be changed right now." | The order was confirmed automatically less than Post-confirmation edit lock (minutes) ago | Wait until Edit-locked until has passed. A shorter lock applies only to later confirmations |
Effect on the rest of Lattice
- The edit lock is checked whenever a sales order line is validated before it is saved or deleted, which pages and data imports normally do, so users and integrations alike are refused until Edit-locked until has passed. Switching the policy off lifts every lock at once.
- A held order is stopped by the standard order hold, as for any other hold. The policy only places the hold; it never removes one.
- Confirmations by the job use the confirmation number sequence, like any other confirmation.
- While the license blocks Lattice on a production environment, the job still checks prices and places holds, but every automatic confirmation is refused: those orders become Processed and are not confirmed later.
- Two jobs in the same legal entity do no good: each run already takes every waiting order.
Related
- I want to set up the inbound order guardrails
- I want to schedule the Lattice jobs that are not background processes
- I want to see and release orders held by the inbound order policy
- I want to know whether an order I created is held or edit-locked
- Setting the inbound order guardrails
- What happens to a held order
- Inbound order policy state
- Inbound order policy parameters