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)

How to post existed Purchase Pending Invoice using X++

(0) ShareShare
ReportReport
Posted on by

Hi erveryone:

        I have created some pending invoices (VendInvoiceInfoTable / Line / SubTable / SubLine), but I don't know how to post them using X++? Can anyone give me some suggestions! The more detailed the better!

Best regards and thanks.

Parker

*This post is locked for comments

I have the same question (0)
  • Angel Moreno Heuer Profile Picture
    50 on at

    Did you find the answer to your question? I have the same question.

  • Suggested answer
    Andrew Xu Profile Picture
    3,877 on at

    Try this,

    static void job1(Args _args)

    {

       VendInvoiceInfoTable vendInvoiceInfoTable;

       PurchFormLetter pfl;

       Num num;

       ;

       ttsBegin;

       vendInvoiceInfoTable = VendInvoiceInfoTable::find('Your PO Number','',true);

       // Make sure you have invoice number assigned to the pending invoice.

       if (!vendInvoiceInfoTable.Num)

       {

           vendInvoiceInfoTable.Num = 'Your Invoice Number';

           vendInvoiceInfoTable.update();

       }

       ttsCommit;

       pfl = PurchFormLetter_Invoice::newFromSavedInvoice(vendInvoiceInfoTable);

       pfl.update(vendInvoiceInfoTable.purchTable(),vendInvoiceInfoTable.Num);

       info('done');

    }

  • Angel Moreno Heuer Profile Picture
    50 on at

    It works! Thanks.

  • Manpreet Profile Picture
    15 on at

    Hi,

    I have to create and post a pending vendor invoice without a Purchase order using code.

    Can I get any help here?

    Thanks.

  • Angel Moreno Heuer Profile Picture
    50 on at

    Read the answer of Andrew Xu please.

  • Abdul Yousufzai Profile Picture
    10 on at

    Hi,

    Have you find the way to create and post a pending vendor invoice without a Purchase order using code??

    I want to do the same , could you plz guide on this.

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans