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

How to drop the lines in Purchase Order?

(0) ShareShare
ReportReport
Posted on by 2,304 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);

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,977 Super User 2025 Season 2 on at
    RE: How to drop the lines in Purchase Order?

    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,163

#2
OussamaSabbouh Profile Picture

OussamaSabbouh 1,908

#3
YUN ZHU Profile Picture

YUN ZHU 1,878 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans