Tuesday, 9 October 2018

Import WBS lines in request for quotation lines in D365 through X++ code

Recently I have a requirement of importing the work breakdown structure lines on request for quotation lines as per associated project. So for achieving the requirement I have develop a job that can get the WBS lines and import those line on RFQ using AxPurchRFQCaseLine class. Please see below screenshots.

Work break down structure lines which needs to be imported:

Source code of a method which breakdown in three images:

Image 1.1:

Explanation of below source code image:
  • Initialize tables, class and edt buffers.
  • Get RFQ. (Here I have hardcoded RFQ Id)

Image 1.2:

Explanation of below source code image:
  • Query to iterate smmActivityParentLinkTable table that contains the references to entities which are associated with an activity.
  • Sub query to iterate PSAActivityEstimates table that contains project quotation estimates.
  • Declaration of AxPurchRFQCaseLine class.
  • Set OOTB Parm methods of the class that can handle the given values.

Image 1.3:

Explanation of below source code image:
  • Save method of AxPurchRFQCaseLine class that inserts the records also runs all the possible validations for request for quotation lines.


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...