As we know, “InventTrans” table is one of the largest table in Microsoft D365 for finance and operations and this table keep growing through out the ERP lifecycle and consume more space. BUT ! here is the good news that Microsoft has released a standard feature and a standard batch job to archive inventory transactions and purge InventTrans table data.
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.
Uninstall/Remove a Model/Package From Production & UAT Environment of Microsoft Dynamics Finance and operations.
Steps
Create a file that is named ModuleToRemove.txt.
In the file, put the name of each module that you want to remove on a separate line. Make sure that you’ve completed the prerequisites for each module that you’re removing.
Create a valid deployable package, and put the ModuleToRemove.txt file in the package\AOSService\Scripts folder.
Install/Deploy the deployable package in UAT or production environment.
Verify that the package was uninstalled before you complete this procedure in a production environment.
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'
Resolution
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.
There are many process in Microsoft Dynamics 365 Finance and Operation which run in background as a batch jobs. The Debugging of Batch Jobs In Visual Studio is very common requirement.
Steps
Go the Debug Menu & Click on “Attach To Process”.
Show process from all users should be selected YES
Attach To Value should be -Automatic: Managed (v4.6, v4.5, v4.0) code
Select Process “Batch.exe” from available processes & run your batch job. Breakpoint will hit and you will be able to debug your code.
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