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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Create Purchase quote automatically using records from another page

(0) ShareShare
ReportReport
Posted on by 45

i have created a page that fetch value from job planning line and also in that i have added filled vendor name and that vendor name filled getting a data from vendor table but now i wanted that data needs to be filled in purchase quote automatically or directly create a purchase quote using values from this page

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    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.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    So what you want is a action button in your page that creates the purchase quote?

    You can add an action like this and complete it with your data.

    action(CreatePurchaseQuote)
                {
                    Caption = 'Create purchase quote';
                    ApplicationArea = all;
                    trigger OnAction()
                    var
                        PurchaseHeader: Record "Purchase Header";
                        PurchaseLine: Record "Purchase Line";
                        LineNo: Integer;
                    begin

                        PurchaseHeader.Init();
                        PurchaseHeader."Document Type" := PurchaseHeader."Document Type"::Quote;
                        PurchaseHeader."No." := '10000'; // The document No
                        PurchaseHeader.Validate("Buy-from Vendor No.", '10000'); // Your vendorNo
                        //Fill the rest of the fields in the head
                        PurchaseHeader.Insert(true);
                        //Create line
                        //Repeat for every line
                        PurchaseLine.Init();
                        PurchaseLine."Line No." := LineNo;
                        PurchaseLine."Document Type" := PurchaseHeader."Document Type";
                        PurchaseLine."Document No." := PurchaseHeader."No.";
                        PurchaseLine.Type := PurchaseLine.Type::Item;
                        PurchaseLine.Validate(PurchaseLine."No.",'10000'); // Your item no
                        PurchaseLine.Validate(Quantity,1); // Your quantity
                        //fill in the rest of the fields on the line
                        LineNo += 10000;
                        PurchaseLine.Insert(true);
                       

                    end;
                }
  • Suggested answer
    YUN ZHU Profile Picture
    98,235 Super User 2026 Season 1 on at

    Hi, I think you can refer Create Sales Invoice feature in Job Planning Lines page.

    pastedimage1649206930230v1.png

    Some sample code:

    pastedimage1649207009787v2.png

    pastedimage1649207029677v3.png

    pastedimage1649207067750v4.png

    Hope this will help.

    Thanks.

    ZHU

  • Pooja Zinjurke Profile Picture
    45 on at

    Thanks Andy Sather

  • Pooja Zinjurke Profile Picture
    45 on at

    Thank you Inge M. Bruvik, I have verified this and its working.

  • Pooja Zinjurke Profile Picture
    45 on at

    Thank you YUN ZHU.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans