Announcements
I have create a custom table "Cost Sheet Header".set workflow for this table.
create tableextension for "approva entry" table add Customer Name,Machine No. . I want to show this fields on Request To approve page so create page extension for
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Approvals Mgmt.", 'OnPopulateApprovalEntryArgument', '', true, true)] local procedure SetPopulateApprovalEntryArgument(var RecRef: RecordRef; var ApprovalEntryArgument: Record "Approval Entry"; WorkflowStepInstance: Record "Workflow Step Instance") var RecMachineCostSheet: Record "ST_Cost Sheet Header"; RecINRCostSheet: Record "ST_INR CostSheet Header"; IsHandled: Boolean; begin case RecRef.Number of DATABASE::"ST_Cost Sheet Header": begin RecRef.SetTable(RecMachineCostSheet); ApprovalEntryArgument."Document No." := RecMachineCostSheet."Cost Sheet No."; ApprovalEntryArgument."Customer Name" := RecMachineCostSheet."Customer Name"; ApprovalEntryArgument."Machine Category" := RecMachineCostSheet."Machine Category"; ApprovalEntryArgument."Machine Model No." := RecMachineCostSheet.Model; ApprovalEntryArgument."Enquiry Quantity" := RecMachineCostSheet."Enquiry Quantity"; ApprovalEntryArgument.Amount := RecMachineCostSheet."Offer Net price(With Usance)"; end; end; end;
Hi
Please try this event
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Approvals Mgmt.", 'OnBeforeApprovalEntryInsert', '', true, true)]
Hi Sejal,
Did you found any solution on this as I also stuck on the same situation.
Thanks
Please try to use OnAfterInsert trigger for that Request to approve Table. Check the table from the behind of this page. by using Ctrl+Alt+f1
Thanks.
Hello - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
I will open this up to the community in case they have something to add.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156