ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] TimeSheetApprovalManagement.Codeunit.al - OnApproveOnBeforeCheckApproverPremissions
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;
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.