Thursday, 11 October 2018

Job to create prepayment against purchase order in D365

Vendor's prepayment in procurement process is a very common practice and in such scenario an organization should be able to track purchase order & their prepayments. In this blog I will discuss how can you create prepayment by X++ code in Microsoft Dynamics 365. Please find below screenshots.

Prepayment screen:













Source code of a method, which is breakdown in two images:


Image 1.1:

Source Code Explanation:
  • Get purchase order.
  • Initialize purchprepaytable buffer.
  • Set values.
  • For this example I have used prepayment type "Percent".

























Image 1.2:


Source Code Explanation:
  • Get purchase order total amount through PurchTotals class.
  • Run calculation of Purchase order total amount through calc() method.
  • Done calculation for Limit and available prepayment fields.
  • Set prepay category Id.
  • Insert record.











Job runs successfully.












Result:


No comments:

Post a Comment

Set up Online VM for Dynamics 365 Finance and Operation for Technical and Functional Learning Purposes

In this blog, I will discuss how we set up an online VM for D365F&O for Technical and Functional learning purposes for free. Step: 1 Cl...