Create checks from triggers
A quality control trigger creates a check automatically when a configured document event occurs. Triggers are the primary way to embed quality control into existing business processes — for example, inspecting incoming inventory when a purchase receipt is posted, running an in-process check when a production order starts, or scoring outbound shipments at sales shipment.
This page describes how triggered checks behave at runtime. To configure triggers, see Set up quality control triggers.
How triggered checks are created
When the configured event occurs, the system evaluates all triggers matching the document type, action, and filters. One check is created per matching trigger. Each check inherits the plan and team from the trigger and is linked to the source document via document type and document number.
If multiple triggers match the same event, multiple checks are created. For Production Order triggers, the Allow Multiple Open Checks field on the trigger controls whether more than one open check can exist for the same production order at the same time.
Linking to posted documents
For triggers that fire at document posting — such as purchase receipt Post — the resulting check is linked to the persistent posted document. The system records the Posted Document Type and Posted Document No. fields on the check.
The link is maintained even after the source warehouse document is deleted, and regardless of whether the check or the warehouse document is posted first. This relationship supports full traceability between purchasing, warehouse, and quality control records.
When a warehouse shipment or warehouse receipt contains lines from several source documents, each check is linked to the posted document of its own customer or vendor. A check that has no source number, such as a check created with the Single Check per Warehouse Document checkbox selected, is linked to the first source document that is posted and keeps that link.
To view linked records:
- Open the Quality Control Check page and use the Related actions or FactBox to open the linked posted document.
- Alternatively, open the Posted Warehouse Receipt or Posted Purchase Receipt and use the Related actions or FactBox to view the linked quality control checks.
In addition to the document link, the check records the order it traces back to in the Order Document Type and Order No. fields when it is created. This makes every check taken against the same order reachable from any one of them, and from the posted invoice. For more information, see View quality control checks for an order.
Per-lot checks
When Per Lot is selected on a trigger, the system creates one check per lot number on the source document line.
To view the lots associated with a source document line, select the Lot No. field on the General FastTab or the Details FactBox of the Quality Control Check page. The Lot No. List page opens, filtered to the lots assigned to the item tracking lines of the associated source document line. The system reflects any subsequent changes to those item tracking lines.
Create one check per warehouse document
By default, a trigger with the quality check type General on a warehouse shipment or warehouse receipt creates one check for each customer or vendor on the warehouse document. A warehouse shipment with lines for three customers therefore gets three checks, and several orders for the same customer share one check.
To create one check for the whole warehouse document instead:
- Select the Search icon
, enter Quality Control Triggers, and choose the related link. -
Select the trigger, or create a new one, and set the following fields:
Field Value Document Type Select Sales Shipment, Sales Return Receipt, Purchase Receipt, or Purchase Return Shipment. Quality Check Type Select General. Source Type Select All Customers or All Vendors. -
Select the Single Check per Warehouse Document checkbox.
The check is created at the document action set on the trigger, in the same way as any other triggered check. It carries the number of the warehouse shipment or warehouse receipt in the Document No. field and the document type of the trigger in the Document Type field, such as Sales Shipment. The check keeps the Customer or Vendor source type, but its Source No. and Source Name fields are blank. If the process runs again for the same warehouse document, the existing check is reused and no second check is created.
When the Finished Before Posting Doc checkbox is selected on the trigger, the warehouse shipment or warehouse receipt cannot be posted until the check is completed or deleted. After posting, the check is linked to the posted document as described in Linking to posted documents.
The check created for the whole warehouse document has no source number, so it is not found when quality control checks are filtered by customer or vendor.
For example, a Sales Shipment trigger is set up with the Release document action, the quality check type General, the source type All Customers, and the Single Check per Warehouse Document checkbox selected. When a warehouse shipment with sales lines for customers C00001 and C00002 is released, one check is created for the warehouse shipment. With the checkbox cleared, two checks are created, one for each customer.
Reopening a source document
When a released source document is reopened by choosing Home > Release > Reopen, existing quality control checks created by triggers and not in-progress are deleted. When the document is released again, new checks are created from the current data.
Shop Floor Production triggers
The Aptean Shop Floor Production (BC) extension adds additional trigger actions for Production Order document types — Start Work Center, Stop Work Center, Failure Work Center, Start Production Order, Finish Production Order, Recurring Time, and Recurring Output Quantity. These actions fire when the corresponding action runs in the Shop Floor Production App rather than when a document is posted in Business Central.
To use these triggers:
- On the Work Center Card, turn on the Show in Shop Floor toggle.
- Assign users to the work center via Work Center > Shop Floor Users.
- Configure a trigger on the Quality Control Triggers page with the appropriate document action.
For more information on these setup steps, see Set up users per work center in the Shop Floor Production (BC) documentation. For an overview of how QCA integrates with Shop Floor Production (BC) at runtime, see Integration with Aptean Shop Floor Production (BC).
For example, starting a production order in the Shop Floor Production App fires the Start Production Order trigger and creates the configured check.