Posts

Optimizing Batch Job Performance in D365 F&O

Image
Batch jobs are the backbone of automation in Dynamics 365 Finance & Operations (F&O). They handle everything from posting journals to processing large data imports. However, poorly configured batch jobs can slow down your environment and frustrate users. This guide explores how to optimize batch job performance for smoother operations. Understanding Batch Jobs Batch jobs run asynchronously on the server, allowing long-running tasks to execute without blocking user sessions. Each job consists of tasks that can be distributed across batch servers. Common performance issues include: Jobs stuck in executing state. Long queue times due to limited batch threads. Resource contention between batch servers. Step-by-Step Optimization 1. Review Batch Server Configuration Ensure your batch servers are properly configured: Go to System Administration → Setup → Batch Group . Assign jobs to specific servers based on workload. Avoid overloading a single server with multiple heavy jobs. 2. Adju...

Efficient Field Selection in X++ Queries

Image
Selecting only the fields you need in X++ queries is one of the simplest ways to improve performance in Dynamics 365 Finance & Operations. Many developers start with select * out of habit, but that approach can slow down data retrieval and increase memory usage. Why It Matters When you use select * , the system fetches every column from the table—even those you don’t need. This adds unnecessary overhead, especially when working with large tables like CustTable or VendTable . By selecting only the required fields, you reduce the data transferred between SQL Server and the application layer. Example: Inefficient vs. Efficient Query // Inefficient query select * from CustTable where CustTable.AccountNum == '1000'; // Efficient query select CustTable.AccountNum, CustTable.Name from CustTable where CustTable.AccountNum == '1000'; The second query retrieves only the AccountNum and Name fields, making it faster and cleaner. Bonus Tip: Use SysDa Framework For more read...

Troubleshooting Performance Counter Initialization Error in D365 F&O

Image
Performance counters are essential for monitoring system health and performance in Dynamics 365 Finance & Operations (F&O). Occasionally, developers encounter the dreaded “Performance Counter Initialization Failed” error when starting their development virtual machine (VM). This guide walks you through understanding, diagnosing, and fixing the issue. Understanding the Error This error typically appears when the performance counters on your Windows system become corrupted or inaccessible. It prevents the AOSService from initializing correctly, leading to slow startup or failed service launches. Common causes include: Corrupted performance counter registry entries. Missing permissions for the AOSService account. Incomplete system updates or interrupted installations. Step-by-Step Fix Follow these steps to resolve the issue: Check Event Viewer Logs Open Event Viewer → Windows Logs → Application . Look for entries related to PerformanceCounter or AOSService . Rebuild Performanc...

5 Practical X++ Tips for D365 F&O Developers (That Actually Save Time)

Image
Whether you’re new to X++ or have been working with Dynamics 365 Finance & Operations (D365 F&O) for years, there are small patterns and habits that can make your life much easier. In this post, I’ll share 5 practical X++ tips that I’ve seen repeatedly help in real projects – from safer queries to more maintainable and performance-friendly code. ─── Environment • Product: Dynamics 365 Finance & Operations / Finance and Supply Chain Management • Language: X++ • Context: Customizations, extensions, and integrations in D365 F&O These tips are focused on real-world scenarios you’re likely to encounter in daily development. ─── Tip 1 – Prefer while select with clear field lists It’s very common to see: while select * from salesTable { // do something } This works, but it’s not ideal. Pulling all fields can increase IO and memory usage, especially on big tables. Instead, try to: • Select only the fields you need • Make it explicit and easier to read SalesTable s...

Resolving Performance Counter Error on D365 FSCM version 10.0.46

Image
When working with a local virtual machine (VM) downloaded from the LCS portal (VHD image), I encountered an issue despite completing all installation and build steps successfully. Problem Description During the creation of a Purchase Order or Free Text Invoice, the system immediately displayed the following error message and prevented record creation: “The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.” Root Cause This error occurs due to improper initialization of performance counters within the AOSService environment. The counters are expected to be read-only, but the system attempts to access them incorrectly. Resolution The issue can be resolved by executing a PowerShell script that reinitializes the performance counters for the AOSService. Steps: Backup your code, data, any pending works. Stop all the related services. Open PowerShell with administrative privileges. Note : If your AOSService folder is located on a different drive, upda...

Overview of unified ERP provisioning in Power Platform (Dynamics 365 F&O/D365 FSCM)

Image
Dynamics 365 Finance and operations apps are now hosted on Microsoft Dataverse, so you can provision ERP alongside other Dynamics 365 and low‑code apps directly in the Power Platform admin center or via API/PowerShell.  Templates streamline environment creation by preinstalling ERP workloads, and a dedicated Provisioning app adds ERP capabilities to existing environments that already have Dynamics 365 apps enabled. 1. Prerequisites and licensing Licenses : You must have a related Dynamics 365 ERP license (e.g., Finance, Supply Chain Management, Project Operations, Commerce) or the Dynamics 365 Operations Application Partner Sandbox. Admins with the Power Platform Administrator or Dynamics 365 Administrator role can create/manage environments without a full user license, subject to a ~12‑hour cache delay after role assignment. Capacity : At least 1 GB available in both Operations and Dataverse database capacities is required. Environment type: Use Sandbox or Trial (subscription‑bas...

How to use X++ macro in Dynamics 365 F&O (D365 FSCM)?

Image
Macros in X++ are precompiler directives that let you define reusable symbols, values, or code fragments before compilation. They are powerful but considered legacy, so Microsoft recommends using language constructs instead. 🔑 Key Points About X++ Macros What Are Macros? Macros are processed before compilation: The compiler never sees the directive itself, only the expanded characters. Legacy feature: They may be deprecated in future releases. Prefer constants or constructs like SysDa for queries. Defining Macros Syntax: #define.MyMacro(Value)   // macro with value #define.AnotherMacro()   // macro without value Case-insensitive: Macro names and directives are not case-sensitive, but best practice is to start names with uppercase. Conditional checks: #if.MyMacro // Code included if defined #endif #ifnot.MyMacro // Code included if not defined #endif Removing Macros #undef removes a macro definition: #undef.MyMacro Using Macro Values Macros can hold character...