ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] TimeSheetApprovalManagement.Codeunit.al - OnApproveOnBeforeCheckApproverPremissions

Open andersws opened this issue 5 years ago • 1 comments

Can you please add OnApproveOnBeforeCheckApproverPremissions to procedure Approve in Codeunit 951, "Time Sheet Approval Management"?

procedure Approve(var TimeSheetLine: Record "Time Sheet Line")
    var
        IsHandled: Boolean;
    begin
        IsHandled := false;
        OnBeforeApprove(TimeSheetLine, IsHandled);
        if IsHandled then
            exit;

        with TimeSheetLine do begin
            if Status = Status::Approved then
                exit;
            TestField(Status, Status::Submitted);
            // >>>>>>>>>>>>>
            OnApproveOnBeforeCheckApproverPremissions(TimeSheetLine, IsHandled);
            if not IsHandled then
                CheckApproverPermissions(TimeSheetLine);
            // <<<<<<<<<<<<<
            Status := Status::Approved;
            "Approved By" := UserId;
            "Approval Date" := Today;
            OnApproveOnBeforeTimeSheetLineModify(TimeSheetLine);
            Modify(true);
            case Type of
                Type::Absence:
                    PostAbsence(TimeSheetLine);
                Type::Service:
                    AfterApproveServiceOrderTmeSheetEntries(TimeSheetLine);
            end;
        end;

        OnAfterApprove(TimeSheetLine);
    end;
[IntegrationEvent(false, false)]
local procedure OnApproveOnBeforeCheckApproverPremissions(var TimeSheetLine: Record "Time Sheet Line"; var IsHandled: Boolean)
begin
end;

andersws avatar Jul 28 '21 07:07 andersws

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

JesperSchulz avatar Jul 30 '21 06:07 JesperSchulz