Introduction COC (chain of command) & Method Wrapping In Microsoft Dynamics 365 finance and operations –
Microsoft D365 Finance and operations supports very powerful feature called COC or method wrapping.
In past, Microsoft Dynamics AX/Axapta supports overlayering where you can overlayer Microsoft classes, table methods etc directly by placing your code in the middle, bottom or top if standard code. Below is screenshot and example for your reference. In below screenshot i placed my custom code in the middle of standard method by using overlayering.
In Microsoft Dynamics 365 finance and operations (After version 8.0) , you cannot overlayer code as everything is sealed now. We have to use COC or method wrapping.Microsoft has improved the Functionality of Class extension for D365 FO by adding wrap logic around methods which are defined in the base class that you are augmenting. You can Wrap or do Chain of command (COC) of public and protected methods.
In below screenshot i am using method wrapping or class extension of standard class which is different from Microsoft Dynamics AX overlayering approach.
Next keyword means to call the orginal method “ChecItemPostingDate” of standard class “InventUpdate”
You can get values of Global Variables of in your extension class of your parent class or main class.
Final Modifier means The method can’t be overridden in any class that derives from its class.
Here are one more example where we are using COC (chain of commands) in Table methods.
Benefits Of Using Change Of Commands instead of Old Overlayering approach in Microsoft Dynamics 365 finance and operations
Easy Future upgrades and version enhancements as you are not doing overlayering in standard classes or methods or objects & keeping you separate extension classes.
Neat & Clean development as no need to compile whole code librarary.
Introduction – Data management framework of Microsoft Dynamics 365 finance and operations contains a very important technical asset called Data Entities. Data entities are conceptual combinations, abstraction and encapsulation of one of more underlying tables. Data entities in Microsoft D365 finance and operations are used to import and export data in Microsoft Dynamics finance and operations. Odata integration can also be achieved using D365 finance and operations data entities. We can customize standard data entity . Click Here to know about standard data entity customization.
Composite Data entity vs Simple Data Entity- There are some differences between Composite Data entity & Simple Data Entity. 1 ) First of all simple data entity contains one or more tables where as composite data entity contains multiple data entities 2) Simple Data entities support Odata & can be used in Odata integration whereas Composite data entities cannot be used Odata integration.
Where should we use Composite Data entity ?-Composite entity is used in scenarios where an entity can be represented as a single document, like Purchase Header/line , Sales header/line, Invoice header/line etc.
Example & Development of Composite Data entity steps are mentioned below :
In example i am taking 2 separate standard data entities i.e. PurchPurchaseOrderHeaderV2Entity & PurchPurchaseOrderLineV2Entity
PurchPurchaseOrderHeaderV2Entity contains purchase order header information & fields mainly purchTable Fields
PurchPurchaseOrderLineV2Entity contains purchase order Lines information & fields mainly PurchLine Fields
We will develop a new composite data entity by using above 2 data entities and compose data entity will represent a single purchase order document (Purchase Order Header + Purchase Order Line)
Now create a composite data entity in your project.
Extend PurchPurchaseOrderLineV2Entity and create relation with PurchPurchaseOrderHeaderV2Entity. (NOTE In my case standard relation is already there so no need to create any customize relation)
Right click on your composite data entity and add “New Root Data Entity Reference” and make sure property Data Entity should be equal to PurchPurchaseOrderHeaderV2Entity
Right click on your “New Root Data Entity Reference” PurchPurchaseOrderHeaderV2Entity and add “New Embedded Data Entity Reference” equals to PurchPurchaseOrderLineV2Entity & Property Relation should be equal to PurchaseOrderHeader.
Extend staging table (PurchPurchaseOrderLineV2Staging) of data entity PurchPurchaseOrderLineV2Entity and add relation with the staging table (PurchPurchaseOrderHeaderV2Staging) of data entity PurchPurchaseOrderHeaderV2Entity.(NOTE : In my case standard relation already exist so i am not creating any relation)
Add two columns, RowId and ParentRowId (type int), on all the staging tables i.e. PurchPurchaseOrderHeaderV2Staging & PurchPurchaseOrderLineV2Staging.
Create a cluster index on the staging tables which includes RowId, ParentRowid,DefinitionGroup, and ExecutionId for getting good performance .
Build and synchronize your project
Under “Data import/export framework parameters”, select fast tab “Entity Settings” and click on “Refresh Entity List”. Here is LINK AND TUTORIAL.
Requirement: In last post i demonstrated how can we create A New Production Branch In VSTS (Visual Studio Team Services)/Azure DevOps & Microsoft Dynamics 365 finance and operations. To See my last post please click here. In this post i will show how can we Merge Branches in VSTS/Azure DevOps and Microsoft Dynamics D365 finance and operations or how can we move change or CHANGESets from one dev branch to another prod branch. Before starting this tutorial i will recommend you to please go through my last post.To See my last post please click here
Right Click on SOURCE Branch & choose option MERGE
Browse TARGET Branch
You can choose 2 option for branch changes you would like to merge.First one is “ALL CHANGES UPTO SPECIFIC VERSION” & second one is “SELCTED CHANGESETS
Introduction – The Microsoft Dynamics 365 mobile app allows you to access your business processes, data and records from mobile phones and tablets. Microsoft Dynamics D365 Mobile workspaces can be enabled in a very less time with almost no effort. Using Microsoft Dynamics D365 fins and operations mobile user can easily perform below activities :
1. User can view Microsoft Dynamics D365 finance and operations business data in mobile app.
2. User can edit or delete Microsoft Dynamics D365 finance and operations business data in mobile app.
3. Admin can add certain tasks and CRUD operations in D365 workspace and mobile app. User can perform those operations in D365 mobile app.
Example – Below are the steps to create your first Microsoft Dynamics D365 mobile app.
In this scenario we are using vendor master and we will public vendor master workspace and user will be able to view vendor master in D365 mobile app.
Go to settings menu and click on mobile app in Microsoft Dynamics 365.
Create new Microsoft Dynamics 365 mobile app.
Fill all the details of Microsoft Dynamics 365 mobile app.
Add page in Microsoft Dynamics 365 mobile app.
Save the Microsoft Dynamics 365 mobile app.
Publish the Microsoft Dynamics 365 workspace and mobile app.
Login into your Microsoft Dynamics 365 mobile app and start using it
Background – In Microsoft Dynamics D365 Finance and Operations, most of the processes & batch jobs run in a single thread and supports only single thread execution not multi-threading. Generally Single Thread batch Jobs or processes work well in Microsoft Dynamics 365 Fins and ops. But there are many scenarios where we require fast performance and quick competition of processes and batch jobs. Multithreading Batch Jobs approach is very useful in those scenarios.
Two Different Ways– In Microsoft Dynamics D365 Finance and Operations,We can develop Multithreaded Batch Jobs in two ways. The first approach is using PESSIMISTIC LOCKS OR PESSIMISTIC SELECT in Microsoft Dynamics D365 Finance and Operations.
The second is to create BATCH TASKs. Batch Task approach you can find in standard classes like RetailStatementCalculate_Multi, RetailStatementPost_Multi Etc. which are using RunBaseBatch Framework (Not SYSOperation Framework) inside Microsoft Dynamics D365 Finance and Operations.
Lets begin with first approach i.e. using PESSIMISTIC LOCKS OR PESSIMISTIC SELECT in Microsoft Dynamics D365 Finance and Operations.By default, D365 fins and ops supports Optimistic Concurrency model (OCC) during the time SELECT or fetching records from database of Microsoft Dynamics D365 Finance and Operations. Optimistic Concurrency Model or SELECT only locks records during the time of Update whereas Pessimistic Concurrency Control (PCC).
Below code you can utilize in batch jobs and you run multiple thread of same batch job class as we a
Lets move to second approach , which include create and adding RUNTIME task using BATCHHEADER class . Here a single Runbase Batch Job is used for creating multiple threads or Runtime Tasks.
Metadata object with the same name is defined in multiple assemblies.
##[error]C:\DynamicsSDK\Metadata\Microsoft.Dynamics.AX.Application.Build.targets(40,5): Error : Error: AxTableExtension/InventSite.ACXPowerBIExtension/Name - Metadata object with the same name is defined in multiple assemblies: 'WOWMOMO,ACXPOWERBI'
Search the Table Extension InventSite.ACXPowerBIExtension in Application Explorer.
Go the K:\AosService\PackagesLocalDirectory Folder. Choose your model folder and remove extra copy or duplicate copy of InventSite.ACXPowerBIExtension from your model.
Restart visual studio and start build and sychronisation.
Microsoft Dynamics AX, Microsoft Dynamics 365 for Finance and Operations, D365 FO, Retail, SQL, Microsoft Power Apps, Microsoft Power BI, Microsoft Azure, Logic Apps, Microsoft Flow, Microsoft power automate, Microsoft Power Platform,.Net, X++, C#, Power BI DAX, Data Warehousing, Microsoft Analysis Services, SQL Server Reporting Services