Auto Processing
The auto-processing system handles incoming Peppol e-documents (invoices, credit memos, orders) by automatically validating, importing, approving, and posting them in Business Central. It consists of four core codeunits and is controlled by configuration settings.
Architecture overview
flowchart TD
JQ["Job Queue (every 5 min)"]
JQ --> APJ["RSMSTAAutoProcessJobQueue\n<i>Find new docs</i>"]
APJ --> APO["RSMSTAAutoProcessPO\n<i>Validate, import, send to approval</i>"]
JQ --> POST["RSMSTAPostAutoprocessedDocs\n<i>Post approved docs</i>"]
IMP["On Document Import"]
IMP --> APA["RSMSTAAutoPostAndApprove\n<i>Immediate import + post for\nconfigured vendors/customers</i>"]
Core codeunits
1. RSMSTAAutoProcessJobQueue (CU 10058628)
Purpose: Job queue entry point that finds unprocessed vendor documents and feeds them to the processor.
- Runs every 5 minutes
- Filters
IntegrationPeppolHeaderfor status = New or In Matching, account type = Vendor - For each record, calls
RSMSTAAutoProcessPO - On failure: sets document status to Error and stores the error message
2. RSMSTAAutoProcessPO (CU 10058627)
Purpose: The main processing engine for purchase documents. Handles the full lifecycle of a single document.
Flow:
- Skips OCR-generated documents
- Checks for duplicate purchase documents (by vendor + document number across headers, posted invoices, and posted credit memos)
- Validates the document against RSMSTA Validation Setup rules (header fields + line items)
- If linked to an existing PO → updates the purchase order with invoice details
- If no PO → creates a new purchase header from the Peppol data
- Posts to receive (handles warehouse receipt creation if location requires it)
- Sends to approval workflow (sets
RSMSTA Autoprocessed = true) - Compares purchase order amounts with the incoming invoice
Integration events: OnBeforeValidateDocument, OnAfterValidateDocument, OnBeforeOnRun
3. RSMSTAPostAutoprocessedDocs (CU 10058611)
Purpose: Second job queue that posts documents that have been approved.
- Runs every 5 minutes
- Finds Purchase Orders where
RSMSTA Autoprocessed = trueand Status = Released - Posts them with both Receive and Invoice flags set to true
- Updates the
IntegrationPeppolHeaderstatus to Error if posting fails
4. RSMSTAAutoPostAndApprove (CU 10058622)
Purpose: Triggered during document import for vendors/customers with specific auto-posting settings.
- Purchase path: Checks vendor’s posting template for
Automatic Appr. Post of Inv.→ imports and posts immediately. If onlyAutomatically Process Invoiceis set → imports without posting. - Sales path: If
AutoProcessOrderToSO→ creates sales order. IfAuto Post Order→ also posts it. - Validates variance amount against configured threshold before posting.
Document status progression
flowchart LR
A["New / In Matching"] --> B["In Approval"]
B --> C["Released"]
C --> D["Posted (Processed)"]
A -. "failure" .-> E["Error"]
D -. "failure" .-> E
Configuration settings
| Setting | Location | Effect |
|---|---|---|
| Enable Auto-Process Invoices | Purchases & Payables Setup | Master switch — enables/disables both job queues |
| Manual Approvals | Purchases & Payables Setup | Prevents automatic sending to approval workflow |
| Variance Amount | Purchases & Payables / Sales & Receivables Setup | Threshold % for amount variance validation |
| Auto Post to Receive | Purchases & Payables Setup | Controls warehouse-receipt posting during auto-processing — Disabled / Orders / Invoices / Both |
| Automatic Appr. Post of Inv. | Vendor Posting Template | Auto-posts vendor invoices on import |
| Automatically Process Invoice | Vendor Posting Template | Auto-imports vendor invoices (no post) |
| Auto Process Order to Sales Order | Sales & Receivables Setup | Auto-creates sales orders from Peppol orders |
| Auto Post Sales Order | Sales & Receivables Setup | Auto-posts created sales orders |
Per-document-type rules
For finer control, the Centara Auto-Process Setup page (search for it in BC, or open from the Centara Setup menu) lets you define rules that decide whether a specific incoming document type is auto-processed at all — optionally narrowed to a single vendor.
| Field | Description |
|---|---|
| Receive E-Document To | The incoming document type the rule applies to: Purchase Order, Purchase Invoice, Purchase Credit Memo, or Purchase Return Order |
| Vendor No. | Optional — restricts the rule to a single vendor. Leave blank to apply to all vendors |
| Execute Auto-Process | When off, matching documents are imported but parked in New status for manual handling instead of being pushed through the auto-process pipeline |
A typical use case: turn off auto-processing for Purchase Return Orders globally while leaving it on for Invoices and Orders, so returns always get a manual review step.
Manual retry
Users can manually trigger auto-processing on error documents via the Auto Process Document action on both the Inbound Documents page and the Purchase Documents Review page. This runs the same RSMSTAAutoProcessPO codeunit.