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 :
Microsoft Dynamics AX (Archived)

X++ Invoicing a purchase order including markup transactions (charge code) via code x++

(0) ShareShare
ReportReport
Posted on by 2,734

Hi,

I have code to generate the pending invoice data based on product receipts attached to a purchase order.

The PO also has charges attached to it, how do I go about ensuring that these charges get invoiced as well?

They are not being created as VendInvoiceInfoLines and I'm not sure how I ensure they get added during PurchFormLetter call so I was hoping someone could point me in the right direction here to ensure this works.

Thank you

*This post is locked for comments

I have the same question (0)
  • Kauto Profile Picture
    2,734 on at

    Hi

    Can someone simply assist on instructing me on which part of PurchFormLetter to call to ensure my markup transactions on the purchase order header get invoiced?

    Thanks

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at

    You just need to call the update() method on the PurchFormLetter.
    It should post the charges as well.

    Here is a sample code:

    purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice);
    purchFormLetter.update(purchTable, strFmt(“Inv_%1”, purchTable.PurchId));

    After posting the purchase order when you go to the voucher, do you see the charges there?

  • Kauto Profile Picture
    2,734 on at

    Hi

    When I run this i get a message that document date isn't present the invoicing fails, even though i pass a date field in the update parameters

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans