Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

How to pass custom fields to approval entry table when you send approval request.

(0) ShareShare
ReportReport
Posted on by 95

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 

"Requests to Approve".
when send requst to approve then customer name,machine no should be blank on request To approve page.
 
pastedimage1659678842844v1.png

  [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;

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: How to pass custom fields to approval entry table when you send approval request.

    Hi

    Please try this event

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Approvals Mgmt.", 'OnBeforeApprovalEntryInsert', '', true, true)]

  • Shamsheer86 Profile Picture
    Shamsheer86 10 on at
    RE: How to pass custom fields to approval entry table when you send approval request.

    Hi Sejal,

    Did you found any solution on this as I also stuck on the same situation.

    Thanks

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: How to pass custom fields to approval entry table when you send approval request.

    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.

  • Suggested answer
    Andy Sather Profile Picture
    Andy Sather on at
    RE: How to pass custom fields to approval entry table when you send approval request.

    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.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans