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

Key Updates in Dynamics 365 F&O for Version 10.0.39

Here’s a concise summary of the  platform updates  in  Microsoft Dynamics 365 Finance & Operations version 10.0.39 (March 2024) : 1- Add...