Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How to programmatically populate a multi-line purchase order?

(0) ShareShare
ReportReport
Posted on by 60

I am trying to populate a purchase order based on data pulled from another database.

I have created a custom GP form in VS2012, and able to populate the purchase order header information, (Vendor ID, Vendor Name, Date, Buyer ID, Currency ID), but when it comes to the line items I run into problems.

First, I am only able to create one line item; I don't know the flags/commands to tell the code I am on a new purchase order line. I have tried several flags:

PopPoEntry.PopPoLineState.InsertingLine.Value = true;
PopPoEntry.PopPoLineState.IsAddingNew.Value = true;
PopPoEntry.PopPoLineState.RunValidate();
PopPoEntry.LocalNewLine.Value = true;
PopPoEntry.LocalNewLine.RunValidate();

Second,  the line I do add, just vanishes after the code completes. The Item Number, U of M, Qty Ordered,  Unit Cost, Description, Site ID, Qty Canceled, and Extended cost are all populated, but when the procedure ends, the line item vanishes with out any error or notification.

I am guessing my newly entered item is failing validation, but I am not sure where. I have made sure the Vendor Item is created, the Item exists and the Site ID, and the Site ID is specified as the default site.

Any help on this will be greatly appreciated.

*This post is locked for comments

  • ZenLin Profile Picture
    ZenLin 60 on at
    RE: How to programmatically populate a multi-line purchase order?

    Thank you for your response. Our first route was through smart connect, but to handle errors with generally poor data, we would have to create a screen somewhere to notify them that there were errors and give them suggestions and/or allow them to correct the data. Looks like I need to revisit smart connect /econnect.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to programmatically populate a multi-line purchase order?

    Hi Zenlin,

    Using VStools, you can design a custom screen through that you can process the flat files, or load the data from the 3rd party tables to the Grid in the custom screen.

    Through eConnect schema's you can integrate the multiline grid values into a single purchase order.

  • Verified answer
    Andrew John Dean Profile Picture
    Andrew John Dean 1,337 on at
    RE: How to programmatically populate a multi-line purchase order?

    To the best of my knowledge, you cannot use VSTools to create multi-line POs.

    Your available options for creating POs from an external source are

    - eConnect ( or its Web services equivalent)

    - Integration Manager ( or it variations like SmartConnect and Scribe)

    - Direct SQL interface to the GP tables (not recommended)

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans