Document Released
Use the Document Released trigger to run a flow interactively — in your own session, at the moment a user releases a document — for Sales and Purchase documents. Because it runs synchronously, just before the release, the flow can:
- Prevent the release. End the flow with an Error step and the release is cancelled with your message. Ideal for enforcing extra requirements ("a contact person is required before releasing").
- Adjust the document first. End the flow with a Set document field values step and your values are written onto the header before it is released.
Any other AutoFlow step can be used in between (look something up, call a service, and so on).
Supported documents (pick exactly one table):
- Sales Header
- Purchase Header
Typical examples:
- Block releasing a sales order until a project reference is filled in.
- Require an external document number on purchase orders before release.
- Default a responsible person onto the document as it is released.
What happens when the flow runs
- A user releases a Sales or Purchase document from the page.
- AutoFlow applies your field filters. If the document does not match, the release proceeds normally.
- The flow runs to the end, synchronously, before the document is released:
- If it ends with an Error step (or any step raises an error), the release is cancelled and the user sees the message; the document stays Open.
- If it ends with a Set document field values step, those values are written onto the document and the release continues.
- If it just ends, the release continues unchanged.
Only the manual release (a user clicking Release) fires this trigger — releases performed automatically by other processes are left untouched.
Trigger output
Rec— a reference to the document being released, so SmartFields can read its fields (e.g.{{<slug>.Rec.Amount}}) and follow-up steps can use it.
Configure the trigger
Open the flow editor, pick When a document is released (interactive), and complete the card.
Table
Choose Sales Header or Purchase Header.
Interactive sessions only
Leave this on (the default) so the flow runs only when a person releases the document in the client.
Timeout (seconds)
The flow runs while the user releases the document, so keep this short.
Field Filters
Optional. Limit the flow to documents that match certain criteria (for example Document Type = Order).
Change the document: Set document field values
To adjust the document before it is released, end the flow with the Set document field values step (available in Document Released flows). Add a row per field, type a value (SmartField references supported), and choose Validate (as if typed on the page) or Assign (raw value).
Prevent the release
To stop the release, end the flow with an Error step and supply the message the user should see. The document stays Open.
Show a message on the page
Add a Send Notification step to surface a message to the user as a page notification without stopping the release. The step is only available in the interactive document triggers.
Document Modified vs Document Released
These are complementary. The Document Modified trigger reacts to direct field edits and can prevent/change those. Whole-document operations like Release are best intercepted with this trigger, because it hooks the release itself and can cleanly prevent it — the modify trigger cannot reliably roll back a release.