Skip to main content

Auto Finish Production Orders

This feature automatically finishes Released Production Orders that meet your configured completion criteria. It reduces manual administration, closes completed orders promptly, and highlights exceptions for review.

How it works​

A scheduled report reviews all Released Production Orders with a Due Date on or before the current Work Date. For each order, it evaluates every production order line against configurable rules. If all lines pass their checks, the order status is changed from Released to Finished. If any line fails, the order is flagged for manual review.

Processing flow​

  1. The report selects all Released Production Orders where Due Date is on or before the Work Date.
  2. Orders previously flagged as Status Change Failed are skipped. You must finish these manually.
  3. Each production order line is evaluated against the rule assigned to its item, item category, or location.
  4. If all lines pass, the order is automatically finished.
  5. If any line fails, the order is flagged as Validation Failed and skipped.
  6. A log entry is created for every order and every line evaluated.

Setting up rules​

A rule is a set of conditions that define when a production order line is considered ready to finish. Configure rules on the Auto Finish Production Order Rules page.

FieldWhat it does
CodeA unique identifier for this rule.
DescriptionA friendly description of when this rule applies.
EnabledTurn the rule on or off without deleting it.
Validate OutputCheck that produced quantity meets expected quantity within tolerance.
Validate ConsumptionCheck that component consumption meets expected quantities within tolerance.
Validate RoutingCheck that all routing operations are finished.
Validate VarianceCheck that cost variance between actual and expected output is within tolerance.

Tolerance settings​

For Output and Consumption, you can set tolerance by:

Tolerance TypeMeaning
QuantityActual quantity must be at least Expected minus the tolerance quantity.
PercentageActual quantity must be at least Expected multiplied by (1 − tolerance %).
BothBoth the quantity and percentage thresholds must be met.
note

When Validate Consumption is enabled, the system always checks that at least one consumption transaction has been posted for each required component, regardless of the tolerance type.

Consumption Tolerance Qty units

Actual consumption is always stored in the item's base unit of measure, for example KG. Enter the Consumption Tolerance Qty value in the same base unit of measure, regardless of what unit of measure the component line uses.

For Variance, the same tolerance type options apply:

Tolerance TypeMeaning
PercentageCost variance % must be within the configured Variance Tolerance %.
QuantityAbsolute cost deviation, in LCY, must be within the configured Variance Tolerance Amt.
BothBoth the percentage and absolute amount thresholds must be met.

Assigning rules​

Rules are assigned at three levels, in priority order:

PriorityLevelWhere to set it
1 (highest)ItemItem Card, AFPO Rule Code field
2Item CategoryItem Categories page, AFPO Rule Code field
3 (lowest)LocationLocation Card, AFPO Rule Code field

The system checks Item first. If no rule is set, it checks the item's Item Category. If still empty, it checks the Location of the production order line. If no rule is found at any level, the line is not evaluated and the order will not auto-finish.

Validation checks explained​

Output validation​

Compares the Finished Quantity on the production order line against the Quantity, the expected output. The line passes if the finished quantity is within the configured tolerance.

Consumption validation​

For each component on the production order line:

  • Components with a Backward flushing method are always skipped. Their consumption is posted automatically when the production order is finished, so they cannot block the auto-finish process.
  • For all other components with Expected Quantity greater than zero, at least one consumption transaction must be posted. This check always applies when Validate Consumption is enabled.
  • The Consumption Tolerance Type then determines the quantity comparison. Actual consumption and the expected quantity threshold are both evaluated in the item's base unit of measure.
  • If a line has no components, consumption validation automatically passes.

Routing validation​

Checks that all routing operations linked to the production order line have a status of Finished. If the line has no routing assigned, this check automatically passes.

Variance validation​

Cost variance is calculated as:

Variance % = |Actual Cost − Expected Cost| ÷ |Expected Cost| × 100

Variance Amt = |Actual Cost − Expected Cost|

Where:

  • Expected Cost = Line Quantity × Unit Cost
  • Actual Cost = the sum of Cost Amount (Actual) from posted Output item ledger entries

The line passes based on the configured Variance Tolerance Type:

  • Percentage — Variance % must be within the Variance Tolerance %.
  • Quantity — Variance Amt must be within the Variance Tolerance Amt.
  • Both — both conditions must be satisfied.

Warehouse validation​

Always performed. Open warehouse activities block auto-finish regardless of any other rule settings. The check confirms that no open warehouse activity lines exist for the production order line, covering both component picks and output put-aways.

Running the report​

Manual run​

  1. Search for Auto Finish Production Orders in Tell Me.
  2. Optionally set filters on the request page for Production Order No., Source No., Description or Due Date.
  3. Choose whether to run in Simulate Only mode.
  4. Run the report.

Simulate Only mode​

When enabled, the report evaluates all orders and logs what would happen, but does not change any production order status. Use this to preview results before running for real.

Scheduling with the job queue​

You can schedule the report to run automatically using a Job Queue Entry. Set up a recurring entry pointing to report AutoFinish Prod. Orders.

Exception handling​

Validation Failed​

If any line on a production order fails its rule checks, the order is flagged with AFPO Status Validation Failed. These orders are automatically retried on the next run, since conditions may have changed.

Status Change Failed​

If all lines pass but the system encounters an error when changing the order status to Finished, for example a posting error, the order is flagged with AFPO Status Status Change Failed. These orders are not retried automatically. You must investigate and clear the flag before the order is processed again.

Reviewing the log​

After each run, the Auto Finish Production Order Log page opens automatically when the report is run interactively. You can also search for it in Tell Me.

The log shows:

  • Order-level entries, with Line No. 0, showing whether the order was finished or skipped and any error text.
  • Line-level entries, showing the rule that was applied and the result of each individual check as Passed, Failed or Skipped.
  • A Simulated flag, indicating entries from a simulation run where no actual changes were made.

Extensibility​

The codeunit publishes an OnAfterCheckFinishConditions event after evaluating all conditions on a production order line. Other apps, such as a shop floor system, can subscribe to this event to override or extend the ready-to-finish decision.

[IntegrationEvent(false, false)]
local procedure OnAfterCheckFinishConditions(ProdOrderLine: Record "Prod. Order Line"; Rule: Record "AutoFinishPORule_AP_TSL"; var IsReadyToFinish: Boolean)

A subscriber can set IsReadyToFinish to true to mark a line as ready, for example when a shop floor system has explicitly marked it complete, or to false to block finishing.