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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create new Purchase Order Line with X++

(0) ShareShare
ReportReport
Posted on by 1,080
Hi,

I'm creating a project that requires me to add a new Purchase Order Line. 
How can I do that in X++.

In addition, how can I check if a Purchase order line has been posted? Right 
now I'm using a select query and passing the PO and Pline number into the 
VendPurchTrans Table. Is there a more efficient way?

Thanks!

*This post is locked for comments

I have the same question (0)
  • user5555 Profile Picture
    7,437 on at

    Hi,

    Do a search on CommIO csv. I have seen some examples on the web how to import a csv into AX PO's.

    Maybe you want to use VendPurchTrans:: (double dot) will give you access to static functions on the data/ business access layer.

    Also take into account that Trans means a posted document and VendPurch is the document.

    J.

  • akuehn Profile Picture
    1,995 on at

    Hi,

    please take a look at these blog article which describes how you can create an po or an po line:
    http://translate.google.com/translate?client=tmpg&hl=en&u=http%3A%2F%2Fblog.ak-home.net%2FPermaLink%2Cguid%2C922ce5c2-b520-42da-b282-e6bf79a0d995.aspx&langpair=de|en

    Example on how to create a new PO line: 

    purchLine.clear();
    purchLine.purchId = purchTable.PurchId;
    purchLine.ItemId = itemId;
    purchLine.createLine(NoYes::Yes, NoYes::Yes, NoYes::Yes,
                         NoYes::Yes, NoYes::Yes, NoYes::Yes);

    To check if a PO line has been posted, you could "analyse" the field PurchStatus on PurchLine Table.

    In addition, if you need a more detailed control (i.e. if on parts of the qty are posted) you could check the posted qty's with some display methode available on PurchLien Table.
    Please take a look at the qty tab for PurchLine on form PurchTable. Theses display method are used there.

  • EduardoAndres Profile Picture
    1,080 on at

    Thank you so much. I saw your answer in the other forum as well.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans