Posts

How to get Dynamics 365 Finance and Operations table sizes

 select S.name+ '.'+ T.name as [table] , (select SUM(rows) from sys.partitions where object_id = tmp.object_id and index_id in (1, 0) ) AS [rows] , data_MB, index_MB, allocated_MB, unused_MB from (select part.object_id ,cast(sum(alloc.data_pages* 8)/ 1024.00 as numeric(16, 2)) as data_MB ,cast(sum((alloc.used_pages- alloc.data_pages)* 8)/ 1024.00 as numeric(16, 2)) as index_MB ,cast(sum(alloc.total_pages* 8)/ 1024.00 as numeric(16, 2)) as allocated_MB ,cast(sum((alloc.total_pages - alloc.used_pages)* 8)/ 1024.00 as numeric(16, 2)) as unused_MB from sys.partitions part join sys.allocation_units alloc on part.partition_id = alloc.container_id group by part.object_id) as tmp join sys.tables T on T.object_id = tmp.object_id join sys.schemas AS S on S.schema_id = T.schema_id where T.type = 'U'  --not counting system tables --and T.name like '%ledger%' --table name filter --and S.name <> 'dbo' --checking for non DBO schema order by allo...

Multi-select In batch job and execution the record with validation Runbase Batch

/// <summary> /// Batch job to update production order physical cost amounts rounded. /// Supports multi-select of Production Orders via SysLookupMultiSelectCtrl. /// </summary> class ProdOrderCostRoundingUpdateBatch extends RunBaseBatch implements BatchRetryable {     container                   ProdID;     SysLookupMultiSelectCtrl    prodIDMultiSelect;     FormBuildStringControl      prodIDCtrl;     DialogField                 ProdIDField;     #define.CurrentVersion(1)     #localMacro.CurrentList         ProdID     #endmacro     /// <summary>     /// Constructs and returns the dialog form for this batch job.     /// </summary>     /// <returns>The constructed dialog.</returns>     public Object...

One time runnable job for production with deployable package

 Class NGUpdateFixedAsNoRunnableJob {     /// <summary>     /// Class entry point. The system will call this method when a designated menu      /// is selected or when execution starts and this class is set as the startup class.     /// --> Update the fixed asset number in US30 & Uk30  <--     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         ProjTable  projTable;         Container con =["US30","UK30"];                 while select  projTable    //crosscompany:con             where (projTable.ProjId == 'C004436-01')                 || (projTable.ProjId == 'PJUS000245_01') || (projTable.ProjId == 'PJUS000245_02')...

Hide work order state on the asset work order form using role based

/// <summary> /// Class EntAssetLifecycleStateUpdate event handlers /// </summary> class VTEntAssetLifecycleStateUpdateEventHandlers {     /// <summary>     ///  Post init based on role removing acces to finish     /// </summary>     /// <param name="args">Args</param>     [PostHandlerFor(formStr(EntAssetLifecycleStateUpdate), formMethodStr(EntAssetLifecycleStateUpdate, init))]     public static void EntAssetLifecycleStateUpdate_Post_init(XppPrePostArgs args)     {         SecurityRole                    role, systemAminRole;         SecurityUserRole                userRole, systemAdminUserRole;         FormRun                         sender = args.getThis();   ...

Nuget Update script

 .\nuget.exe push -Source "D365Build" -ApiKey az .\Microsoft.Dynamics.AX.Application1.DevALM.BuildXpp.nupkg .\nuget.exe push -Source "D365Build" -ApiKey az .\Microsoft.Dynamics.AX.Application2.DevALM.BuildXpp.nupkg .\nuget.exe push -Source "D365Build" -ApiKey az .\Microsoft.Dynamics.AX.ApplicationSuite.DevALM.BuildXpp.nupkg .\nuget.exe push -Source "D365Build" -ApiKey az .\Microsoft.Dynamics.AX.Platform.CompilerPackage.nupkg .\nuget.exe push -Source "D365Build -ApiKey az .\Microsoft.Dynamics.AX.Platform.DevALM.BuildXpp.nupkg ------------------------------------------------------------------------- Build solution script /p:BuildTasksDirectory="$(NugetsPath)\$(ToolsPackage)\DevAlm" /p:MetadataDirectory="$(MetadataPath)" /p:FrameworkDirectory="$(NuGetsPath)\$(ToolsPackage)" /p:ReferenceFolder="$(NuGetsPath)\$(PlatPackage)\ref\net40;$(NuGetsPath)\$(AppPackage1)\ref\net40;$(NuGetsPath)\$(AppPackage2)\ref\net40;$...

Power Automate vs. Logic Apps:

Image

Export All D365 F&O Custom Models with a Single Batch File

  Export All D365 F&O Custom Models with a Single Batch File April 09, 2025   In Microsoft Dynamics 365 Finance and Operations (D365 F&O), managing and exporting models can be a repetitive task, especially when you're dealing with a large number of custom models. To streamline this process, you can automate model exports using a simple batch file. In this blog, I’ll walk you through how to create a  .bat  file that exports all your custom models in one go—without needing to execute each command manually. This is especially helpful during regular backups or before code deployments. 🧠 Why Use a Batch File? A batch file allows you to: Export multiple models in one go Create backups with date-based folders automatically Reduce human error and save time Reuse and modify easily 📂 Folder Structure Assumption In this example, we're assuming the following: D365 metadata is located at  K:\AosService\PackagesLocalDirectory ModelUtil.exe is located in  K:\Aos...