Skip to main content

Posts

Showing posts from October, 2025

πŸ’‘ X++ Tip: Keep the Same Record Selected After Refresh in a Form or Data Source

 When you refresh a form data source in Dynamics AX or Dynamics 365 for Finance and Operations, the current selection is often lost — the cursor jumps back to the first record. This can be frustrating, especially if you want the user to remain on the same record after an update or refresh. Here’s a simple and reliable way to restore the cursor to the same record after the data source is refreshed. 🧩 Scenario Suppose we have a form displaying records from MyTable . When we refresh the data source — for example, after updating a field or calling executeQuery() — we want the form to return to the same record the user was viewing before the refresh. ✅ Solution: Use ds.cursor() We can achieve this using a record buffer and the cursor() method of the data source. public void refreshDataSource() { MyTable myTableRec; // buffer to store current record // Store the current record myTableRec = MyTable_ds.cursor(); // Refresh the data source MyTable_ds.r...

Find InventDimId, SiteId, and Warehouse by ItemId in x++

  πŸ”ΉFind InventDimId, SiteId, and Warehouse by ItemId static void FindInventDimByItemId(Args _args) { InventTable inventTable; InventDim inventDim; ItemId itemId = "A0001"; // πŸ”Έ Replace with your item ID InventOrderSetupType setupType = InventOrderSetupType::Sales; // πŸ”Έ Example setup type // Select item from InventTable select firstOnly inventTable where inventTable.ItemId == itemId; if (inventTable) { // Initialize the InventDim record inventDim.clear(); // πŸ”Ή Get Site (InventSiteId) based on item setup inventDim.InventSiteId = inventTable.inventItemOrderSetupMap(setupType) .inventSiteId(inventDim.InventSiteId, inventTable); // πŸ”Ή Get Warehouse (InventLocationId) inventDim.InventLocationId = inventTable.inventItemOrderSetupMap( setupType, InventDim::findOrCreate(inventDim).InventDimId) .inventLocationId(inventDim...

πŸ”§ How to Apply the Latest Service Update to a D365FO Development VM

Keeping your Dynamics 365 Finance and Operations (D365FO) development environment up to date ensures that your system remains compatible with the latest features, fixes, and security improvements. In this guide, we’ll walk through how to apply a Service Update (CU) to a local development virtual machine (VM) step by step. πŸ“₯ Step 1 – Download the Service Update Package Log in to LCS (Lifecycle Services) . Go to Shared Asset Library → Software Deployable Package . Find and select the Service Update you want to apply. Click Download — the file is usually 5–6 GB , so this might take some time. Once downloaded: Right-click the ZIP file → Properties → Unblock , then click OK . Extract it to a non-user folder (e.g., C:\Altitudo\10_0_23 ). ⚠️ Avoid extracting to your Desktop or Downloads folder. 🧩 Step 2 – Collect Topology Configuration Data Inside the extracted folder, locate DefaultTopologyData.xml . This file defines the VM name and installed components for ...

πŸ”„ Manual Database Synchronization in Dynamics 365 Finance & Operations (On-Premises)

 When working with Dynamics 365 Finance and Operations (on-premises) , there are times when you need to manually synchronize the application database (AXDB) with your metadata. This is especially common after deploying new models, applying hotfixes, or troubleshooting schema mismatches. In this guide, we’ll walk through the manual sync process , how to test SQL connectivity , and a quick troubleshooting checklist to ensure smooth execution. πŸš€ Running the Manual Sync Command The sync is triggered using the Microsoft.Dynamics.AX.Deployment.Setup.exe tool. Below is an example command for a full tables and views sync : C:\ProgramData\SF\SBAOS02\Fabric\work\Applications\AXSFType_App83\AXSF.Code.1.0.20251009185555\bin\Microsoft.Dynamics.AX.Deployment.Setup.exe ^ --setupmode sync ^ --syncmode FullTablesAndViews ^ --metadatadir C:\ProgramData\SF\SBAOS02\Fabric\work\Applications\AXSFType_App83\AXSF.Code.1.0.20251009185555\Packages ^ --bindir C:\ProgramData\SF\SBAOS02\Fabric\work\Applicat...