Reassignment: reacting to it with an event

An open approval changes hands in four ways: a user hands it to somebody else in the Reassign Approval dialog, an escalation step passes it on, Business Central hands it to the substitute on record, or an administrator gives up a claimed entry. Partners and customers with their own development can react to every one of these — with an integration event that is raised after the handover and says who held the approval before and who holds it now.

This page is the developer contract: the event, its parameters, which way produces which values, and an example.

Typical use

A company also tracks its approvals in a ticket system of its own. When an approval moves, the ticket should follow the new assignee, so that nobody has to look in two systems. A subscriber writes every handover into a table of its own and makes the connection from there; the workflow itself is untouched.

The event

Publisher: codeunit DXP AWF Approval Entry Helper, integration event OnAfterApprovalReassigned. It is raised only after the handover has succeeded — so a subscriber may rely on the new approval entries existing, and on an entry still being open for the record.

ParameterMeaning
InstanceID: GuidThe workflow instance the approval belongs to.
RecordID: RecordIdThe record whose approval changed hands — a document or one of its lines.
AssignmentSource: Enum "DXP AWF Assignment Source"What reassigned it: Reassignment when a user handed it on, Escalation for an escalation's reassign step. Blank for a delegation.
SubstitutionReason: Enum "DXP AWF Substitution Reason"Why somebody else holds it: Delegation, Escalation or Administrator. Blank for a reassignment.
PreviousAssigneeType: Enum "DXP AWF Assignee Type"Whom the approval was assigned to before. Blank on entries created before version 1.16 — those do not know their type.
PreviousAssigneeCode: Code[50]The previous approver, workflow user group or external approver.
NewAssigneeType: Enum "DXP AWF Assignee Type"Whom it is assigned to now.
NewAssigneeCode: Code[50]The new approver, workflow user group or external approver.
Reason: TextThe reason the user gave. Empty on the ways that ask for none.

The two enums are the ones the approval entry itself records: Assignment Source and Substitution Reason. A reassignment names an assignment source and leaves the substitution reason blank; a delegation does the opposite — it changes who holds an entry, not whom the stage assigned it to.

Which way produces which values

WayAssignment SourceSubstitution ReasonReason
Reassign Approval — the dialog, the Related approvals FactBox and the line subformsReassignmentblankthe user's mandatory entry
Escalation step "Reassign"Escalationblankgenerated, naming the step no. and the days overdue
Escalation step "Delegate"blankEscalationempty
Delegation to the substitute — Business Central's own wayblankDelegationempty
Administrator gives up a claimblankAdministratorempty

A delegation always goes to a named user, never to a group: PreviousAssigneeType and NewAssigneeType are both Approver there.

Example: recording every handover

codeunit 50112 "MY AWF Reassignment Log"
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"DXP AWF Approval Entry Helper", 'OnAfterApprovalReassigned', '', false, false)]
    local procedure LogHandover(InstanceID: Guid; RecordID: RecordId; AssignmentSource: Enum "DXP AWF Assignment Source"; SubstitutionReason: Enum "DXP AWF Substitution Reason"; PreviousAssigneeType: Enum "DXP AWF Assignee Type"; PreviousAssigneeCode: Code[50]; NewAssigneeType: Enum "DXP AWF Assignee Type"; NewAssigneeCode: Code[50]; Reason: Text)
    var
        Handover: Record "MY AWF Handover";
    begin
        // Only purchase documents are of interest here.
        if RecordID.TableNo() <> Database::"Purchase Header" then
            exit;

        Handover.Init();
        Handover."Instance ID" := InstanceID;
        Handover."Record ID" := RecordID;
        Handover."From Type" := PreviousAssigneeType;
        Handover."From Code" := PreviousAssigneeCode;
        Handover."To Type" := NewAssigneeType;
        Handover."To Code" := NewAssigneeCode;
        // A delegation gives no reason - the substitution reason says it instead.
        if Reason = '' then
            Handover.Reason := Format(SubstitutionReason)
        else
            Handover.Reason := CopyStr(Reason, 1, MaxStrLen(Handover.Reason));
        Handover."Logged At" := CurrentDateTime();
        Handover.Insert(true);
    end;
}

What the event does not do


Revision #1
Created 2026-12-01 08:28:20 UTC by Bernd Feddersen
Updated 2026-12-01 08:28:21 UTC by Bernd Feddersen