web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
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 99

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;

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,613 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
    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
    21,613 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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,710

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,675 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans