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...
Suggested Answer

How to drop the lines in Purchase Order?

(0) ShareShare
ReportReport
Posted on by 2,310 Moderator

I have created the custom dialog box in which we give the Vendor Name, Vendor No, and one Item No. and Item Quantity, as Input and the Purchase Order, is created.

I have created the Purchase Order, but cannot drop the line details...

So my question is how to drop the line details in PO?

this is how I manually drop the line details, but it still doesn't allow me to post my newly created purchase order.

        POLines.Reset();
        POLines.Init();
        POLines."Document No." := POHead."No.";
        POLines."Line No." := 1;
        POLines."Document Type" := DocType;
        // POLines.SetRange("Document No.", POHead."No.");
        POLines.Type := POType::Item;
        POLines."No." := ItemNo;
        POLines.Quantity := ItemQuantity;
        POLines.Description := Item.Description;
        POLines."Description 2" := Item."Description 2";
        POLines."Units per Parcel" := Item."Units per Parcel";
        POLines."Indirect Cost %" := Item."Indirect Cost %";
        POLines."Overhead Rate" := Item."Overhead Rate";
        POLines."Allow Invoice Disc." := Item."Allow Invoice Disc.";
        POLines."Gen. Prod. Posting Group" := Item."Gen. Prod. Posting Group";
        POLines."VAT Prod. Posting Group" := Item."VAT Prod. Posting Group";
        POLines."Tax Group Code" := Item."Tax Group Code";
        POLines.Nonstock := Item."Created From Nonstock Item";
        POLines."Item Category Code" := Item."Item Category Code";
        POLines."Allow Item Charge Assignment" := true;
        POLines."Qty. to Receive" := POLines."Outstanding Quantity";
        POLines."Qty. to Receive (Base)" := POLines."Outstanding Qty. (Base)";
        if Item."Purch. Unit of Measure" <> '' then
            POLines."Unit of Measure Code" := Item."Purch. Unit of Measure"
        else
            POLines."Unit of Measure Code" := Item."Base Unit of Measure";
        POLines.Insert(true);

  • Suggested answer
    Mohana Yadav Profile Picture
    61,248 Super User 2026 Season 2 on at

    you have to store the Purchase Header created and use this while inserting the lines.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 748 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 354 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 351 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans