Approval and rejection: reacting to it with an event Who approved or rejected is recorded on the approval entry and in the audit trail. Many companies want to see it where they work anyway, though — on the document itself, in a report or in another system. Partners and customers with their own development can react to every decision for that: with an integration event that is raised after a person has approved or rejected, and that says who decided what, in which step. This page is the developer contract: the event, its parameters, which way produces which values, and an example. Available from version 1.20. Typical use A company prints on its purchase orders who released them. It has a field of its own, "Approved By", on the purchase header. A subscriber writes the approver into it on every approval of the document; the workflow itself is untouched. The event Publisher: codeunit DXP AWF Approval Entry Helper, integration event OnAfterApprovalDecided. It is raised after the workflow has processed the decision — so the step may already have moved on, or the workflow may be completed. It runs in the same transaction as the decision. Parameter Meaning InstanceID: Guid The workflow instance the approval belongs to. SourceRecordID: RecordId The record the workflow runs for — the document, also when one of its lines was decided. RecordID: RecordId The record that was decided — the document or one of its lines. For a decision on the document it equals SourceRecordID. StageCode: Code[30] The step the decision was made in — before the workflow moved on to the next one. Decision: Enum "DXP AWF User Action" Approve or Reject. DecidedByUserID: Code[50] The Business Central user who decided. Empty for an external approver without a user of their own. DecidedByEmail: Text The e-mail address of whoever decided — for an external approver, the one the response came from. Reason: Text The rejection reason, or an external approver's comment. Empty where none was given. ApprovalEntry: Record "Approval Entry" The decided approval entry, as it was when the decision was made — for anything else, such as the entry number or whether it is a related approval. The decision is in Decision, not in the approval entry's Status. When a user rejects the document, Business Central sets its entry to Rejected only after this event. DecidedByUserID and DecidedByEmail are the values the approval entry keeps in Decided By User ID and Decided By Email — what the Four-Eyes Check is built on. The event is raised exactly where those fields are written. Which way produces which values Way Decision RecordID Reason Approve — through the actions on the document, Requests to Approve, Approve Line(s), the Related approvals FactBox and Approve All Approve document or line empty Reject the document Reject document the rejection reason from the dialog Reject Line(s) — also through the Related approvals FactBox Reject line the rejection reason from the dialog Reject All Reject each line first, the document last the reason entered once External approval — a response from Microsoft Teams or Power Automate Approve or Reject document or line the approver's comment A user who receives their approval requests in Microsoft Teams is reported with their user ID there as well. An External Approver without a Business Central user has only an e-mail address; DecidedByUserID is then empty. Approve All and Reject All raise the event once per decided entry. A group approval raises it once — for the group member who decided; the other members' entries are cancelled, not decided. Example: writing the approver into the document codeunit 50113 "MY AWF Approver Stamp" { [EventSubscriber(ObjectType::Codeunit, Codeunit::"DXP AWF Approval Entry Helper", 'OnAfterApprovalDecided', '', false, false)] local procedure StampApprover(InstanceID: Guid; SourceRecordID: RecordId; RecordID: RecordId; StageCode: Code[30]; Decision: Enum "DXP AWF User Action"; DecidedByUserID: Code[50]; DecidedByEmail: Text; Reason: Text; ApprovalEntry: Record "Approval Entry") var PurchaseHeader: Record "Purchase Header"; begin if Decision <> Decision::Approve then exit; // Only the approval of the document itself, not those of its lines. if RecordID <> SourceRecordID then exit; if SourceRecordID.TableNo() <> Database::"Purchase Header" then exit; if not PurchaseHeader.Get(SourceRecordID) then exit; // An external approver without a user has only an e-mail address. if DecidedByUserID <> '' then PurchaseHeader."MY Approved By" := DecidedByUserID else PurchaseHeader."MY Approved By" := CopyStr(DecidedByEmail, 1, MaxStrLen(PurchaseHeader."MY Approved By")); PurchaseHeader."MY Approved At" := CurrentDateTime(); PurchaseHeader.Modify(false); end; } Advanced Workflow's edit restriction applies to changes a user makes in the client — a subscriber that changes the document in code is not affected by it. What the event does not do It cannot be cancelled. It has no IsHandled parameter and is raised only once the decision has been processed. A person's decisions only. An approval by a rule (Auto Approve) and entries the workflow closes itself do not raise it — nobody decided there. No event without a decision. A refused decision — by the Four-Eyes Check, unmet Preconditions or a Rejection Review — raises nothing. Advanced Workflow approvals only. Entries from a BC standard workflow do not raise it. An error in a subscriber takes the decision back. The event runs in the same transaction; the user sees the error message and the approval stays open. An external response is not processed; the error is then shown on the external approval entry (SharePoint way) or returned to Power Automate (API way). A subscriber should therefore raise an error only where the decision must really not stand. The Audit Trail records the decision anyway. The event is meant for reacting to it, not as a replacement for it. Related pages Reassignment: reacting to it with an event — when an open approval changes hands instead of being decided Where an approval entry comes from — whom an approval was assigned to, and why Module: Approval Preconditions — what can refuse an approval before it counts DEXPRO AWF External Approvals — API Integration Guide