In this blog I will discuss how to create purchase order invoice through X++ code in Microsoft Dynamics 365 finance & operation.
For this example I have created a job, please see source code screenshots below.
Source code explanation (1.1):
- Initialize classes and tables buffers.
- Get purchase order through find method.
- Check Product receipt for the relevant purchase order exists.
Source code explanation (1.2):
- Populate data for insertions in Vendor invoice info table.
- Call insert method of table.
Source code explanation (1.3):
- Insert data in VendInvoiceInfoSubTable .
- Get product receipt lines for iteration, and populate invoice lines accordingly.
Source code explanation (1.4):
Aslamo ali kum!
ReplyDeletei am having error on SLD_WorkProgressAndIPCCONSANT.
error descrioption: The qualifier SLD_WorkProgressAndIPCCONSANT is not valid for field zero.
Please ignore this, as it is the constant file used in my code. For your code you can use constants in file or use directly as literal strings.
DeleteCould it be possible to create a vendor invoice attached to multiple purchase orders ? If so, what changes would you make in your code ?
ReplyDelete