Posts

Batch parallelism or multithreading in Dynamics 365 for Finance and Operations

Image
1. Create a contract class to define the container of the item  Notes: Do not use a list. It may cause the error: “no metadata class defined for data contract object” when the function’s running. Code: [DataContractAttribute] public class ABC_MaterialBalanceContract {        container conItem;      [DataMemberAttribute, SysOperationControlVisibilityAttribute(false)]      public container parmConItem(container _conItem = conItem)      {              conItem = _conItem;                return conItem;      } }    2. Create a service class to process extends SysOperationServiceBase    3. Create a controller class to call the service class (step 2) extends SysOperationServiceController   Code: class ABC_MaterialbalanceController extends SysOperationServiceController {      protected void new() ...

How to customize electronic reporting in D365

Image
1. Overview This  Article  provides an overview of how to customize electronic reporting (ER) from scratch. 2. Basic customize.      2.1 Custom reporting configurations  Overview configurations Data Model Data Mapping configurations Format      2.2 Data Contract Extends ERFormatMappingRunBaseContract Specifies the data contract that should be used to run the configured ER format.      2.3 UI builder class Extends SysOperationAutomaticUIBuilder The provided code looks up only ER formats that contain a data source of the Data model type that refers to the data model by using the Root definition. Notes: ERCustomerModel = name of the data model. ERCustomerDataContainer = name of definition in Model to data source mapping (in image 2)      2.4 Data provider class           Used to run the configured ER format.      2.5 Report service class Extends SysOperationServiceBase Ca...

Build HTML and send email in D365 FO with X++

Image
1. Generate HTML  Note: If you want to add an attribute to a tag, you must follow the below rule: Use addAttribute before Next use renderBeginTag Exp: htmlTxtWriter.addAttribute("colspan", "9"); htmlTxtWriter.renderBeginTag('th'); htmlTxtWriter.renderEndTag();   Result: <th colspan = 9>   public void runNotificationExPicking() {              Query q;          QueryRun qRun;              QueryBuildDataSource qbds,qbdsProdJournalBOM;             QueryBuildRange               qbr,qbrJournalName,qbrJournalJournal;              InventTable            inventTable;              ProdTable                prodTable;    ...