Category: Dynamics 365 F&O Codes

How to Implement Chain of Command (CoC)

The following code example shows how the class must be declared to use CoC. When the ExampleClass.doSomething() method is called, the code will first run all the code before the next keyword. Then, the original code in the ExampleClass.doSomething() method will run. Finally, all code after the next keyword will run. [ExtensionOf(classStr(ExampleClass))]final class ExampleClass_Extension{str doSomething(int arg){// Custom logic before…

Data manipulation Dynamics 365 Finance and Operations

//This will insert a new record into a sample MyCustomerTable table. The only mandatory field that is set on this table is AccountNumber. Insert method private void AddCustomer(){MyCustomerTable myCustomerTable;ttsBegin;select forUpdate myCustomerTable;myCustomerTable.AccountNumber = “1234”;//The new record will have the account number 1234.myCustomerTable.insert();ttsCommit;} Update method //This will update the record where the AccountNumber field is set to…