We need a new event in page 954 "Manager Time Sheet by Job" in procedure local procedure ApproveLines().
Here is the current code :
local procedure ApproveLines()
var
"Action": Option "Approve Selected","Approve All","Reopen Selected","Reopen All","Reject Selected","Reject All";
ActionType: Option Approve,Reopen,Reject;
begin
case ShowDialog(ActionType::Approve) of
1:
Process(Action::"Approve All");
2:
Process(Action::"Approve Selected");
end;
end;
Here is now what we need to add our additional verification :
local procedure ApproveLines()
var
"Action": Option "Approve Selected","Approve All","Reopen Selected","Reopen All","Reject Selected","Reject All";
ActionType: Option Approve,Reopen,Reject;
isHandled: Boolean;
begin
OnBeforeApproveLines(Rec, isHandled);
if IsHandled then
exit;
case ShowDialog(ActionType::Approve) of
1:
Process(Action::"Approve All");
2:
Process(Action::"Approve Selected");
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeApproveLines(var TimeSheetLine: Record "Time Sheet Line"; var IsHandled: Boolean);
begin
end;
Additional context
We need to perform an additional verification before approving the Time Sheet Lines. At the end of our code, we add a popup to either go back or proceed with the approval anyway.
We also add this verification in Page 973 "Time Sheet Card" in procedure local procedure SubmitLines().
In this procedure we can skip the code if needed thanks to event OnBeforeSubmitLines(Rec, IsHandled).
local procedure SubmitLines()
var
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeSubmitLines(Rec, IsHandled);
if IsHandled then
exit;
if not CheckResourceEmployment(RefActionType::Submit, Rec."Resource No.") then
if TimeSheetApprovalMgt.ConfirmAction(RefActionType::Submit) then
Process(RefActionType::Submit);
end;
Describe the request
Hello,
We need a new event in page 954 "Manager Time Sheet by Job" in procedure local procedure ApproveLines(). Here is the current code :
Here is now what we need to add our additional verification :
Additional context
We need to perform an additional verification before approving the Time Sheet Lines. At the end of our code, we add a popup to either go back or proceed with the approval anyway.
We also add this verification in Page 973 "Time Sheet Card" in procedure local procedure SubmitLines(). In this procedure we can skip the code if needed thanks to event OnBeforeSubmitLines(Rec, IsHandled).
Internal work item: AB#545028