Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

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

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;

Categories:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,023 Moderator 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,023 Moderator 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans