microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
786 stars 621 forks source link

[Event Request] Codeunit 1535 "Approvals Mgmt." - DelegateApprovalRequests - OnAfterDelegateApprovalRequestOnBeforeShowApprovalDelegatedMessage #26803

Closed UrbMigle closed 1 month ago

UrbMigle commented 4 months ago

Describe the request

Hi,

Please add a new event publisher OnAfterDelegateApprovalRequestOnBeforeShowApprovalDelegatedMessage in DelegateApprovalRequests of codeunit 1535 "Approvals Mgmt." .

        if ApprovalEntry.FindSet() then begin
            repeat
                ApprovalEntryToUpdate := ApprovalEntry;
                DelegateSelectedApprovalRequest(ApprovalEntryToUpdate, true);
            until ApprovalEntry.Next() = 0;

            OnAfterDelegateApprovalRequestOnBeforeShowApprovalDelegatedMessage(ApprovalEntry, IsHandled);
            if not IsHandled then
                Message(ApprovalsDelegatedMsg);
        end;

    [IntegrationEvent(false, false)]
    local procedure OnAfterDelegateApprovalRequestOnBeforeShowApprovalDelegatedMessage(ApprovalEntry: Record "Approval Entry"; var IsHandled: Boolean)
    begin
    end;

Additional context

Currently there is no way to skip the message about successful approval delegation without skipping the whole code in the procedure. Internal work item: AB#540609

Groenbech96 commented 1 month ago

What is the scenario? Why do you need to skip the message?

UrbMigle commented 1 month ago

We added more entities that can be approved. When batch delegating them using a procedure DelegateApprovalRequests, it throws a message or every entry we are delegating and that's the behavior we are trying to avoid - we would like to show the message only once.

Groenbech96 commented 1 month ago

I suggest to create a BC Ideas for enabling support for batch delegation. We wont introduce an IsHandled event..