Am using AL for new approvals workflows.
Approvals table has fixed document types. how can i add more ?
I have afew failure points. Below code doesn't populate to approvals tables the document no etc
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Approvals Mgmt.",
'OnPopulateApprovalEntryArgument', '', false, false)]
procedure PopulateApprovalEntryArgument(
RecRef: RecordRef;
ApprovalEntryArgument: Record "Approval Entry")
var
QCRec: Record "QC";
begin
CASE RecRef.Number of
DATABASE::"QC":
begin
RecRef.SetTable(PurchaseReq);
ApprovalEntryArgument."Document Type" := QCRec."Document Type";
ApprovalEntryArgument."Document No." := QCRec."QCRec No.";
ApprovalEntryArgument.Amount := QCRec."Expected Total Cost";
ApprovalEntryArgument."Currency Code" := QCRec."Currency Code";
end
END
end;
Also, how can i hide approvals buttons from page for users not qualified to approve ?