Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

How to drop the lines in Purchase Order?

(0) ShareShare
ReportReport
Posted on by 2,203 Super User 2024 Season 1

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
    Mohana Yadav 59,194 Super User 2024 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans