I've created a Purch Order, but I want to post and invoice with partial lines of purch order.
I've been following these steps:
- Intanciate PurchFormLetter with PurchFormLetter::construct(DocumentStatus::Invoice)
- CreateParmTable, CreateParmLine, respectively.
- Executed PurchFormLetter.run()
I've read that is possible use PurchFormLetter.update(), what is the difference, in AX 2009, with run it's works, but in AX2012 is different.
I'll appreciate any help.
Did you achieved this requirement in AX 2012.I am also having same requirement.
I didn´t. Did you find information about it?
Assuming you have access to source code, one good place to look (in AX 2009 or 2012) is CustInvoiceJour.interCompanyUpdate(). You can see there how purchLine.PurchReceivedNow is updated to the quantity to invoice for each PO line, the chooseLinesQuery is defined to include each PO being received, and then purchFormletter specQty is set before calling run.
There are quite a few other calls made to purchFormletter in this example, some of which are required, others which aren't.
Please reply if you need more explanation.
Have you Suggesting update receivenow field and make invoice?
Sergio Sepúlveda M.
Yes. I guess I'm just looking at a known solution that is working already in the product.
Also be aware of the changed tables and from used for vendor invoices. AX2012 is now using the tables VendInvoiceInfoTable, VendInvoiceInfoLine and some more related to the PurchParmUpdate tables.
the data model has changed, read development 4 training of AX 2012
this blog has a simple example.
i have a much more complex scenario that requires invoice matching to receipts. when i work that out, and you still need more inof i will be happy to share.