Skip to main content

💡 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...

🔧 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

  1. Log in to LCS (Lifecycle Services).

  2. Go to Shared Asset Library → Software Deployable Package.

  3. Find and select the Service Update you want to apply.

  4. 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 the update.

2.1 Identify Your VM Name

  1. Right-click This PC → Properties.

  2. Note your Computer name (e.g., AOS-950ed2c3e7b).

  3. Open DefaultTopologyData.xml and replace the <Name> tag value with your actual VM name.

2.2 Identify Installed Components

  1. Open Command Prompt as Administrator.

  2. Navigate to the extracted folder.

  3. Run:

    AXUpdateInstaller.exe list
  4. Copy the list of installed components into a text file (for reference).

  5. Add those components inside the <string> tags in DefaultTopologyData.xml.

  6. Save the file.

✅ After editing, your XML should include:

  • The correct VM name

  • The full list of installed components


⚙️ Step 3 – Generate a Runbook

A runbook defines the step-by-step installation plan for your VM.

Run the following command in the same folder:

AXUpdateInstaller.exe generate -runbookid="10_0_23_runbook" -topologyfile="DefaultTopologyData.xml" -servicemodelfile="DefaultServiceModelData.xml" -runbookfile="10_0_23_runbook.xml"

Parameter Explanation

  • runbookID – Identifier for this update (e.g., 10_0_23_runbook)

  • topologyFile – Path to your DefaultTopologyData.xml

  • serviceModelFile – Path to DefaultServiceModelData.xml

  • runbookFile – The name of the output runbook XML

Once complete, you should see a new file such as 10_0_23_runbook.xml.


🚀 Step 4 – Install the Deployable Package

4.1 Import the Runbook

AXUpdateInstaller.exe import -runbookfile="10_0_23_runbook.xml"

4.2 Verify the Runbook

AXUpdateInstaller.exe list

4.3 Execute the Runbook

AXUpdateInstaller.exe execute -runbookid="10_0_23_runbook"

⏳ The installation process can take several hours, depending on your VM and hardware resources.


💾 Step 5 – Export and Verify the Runbook

Once the process completes successfully:

AXUpdateInstaller.exe export -runbookid="10_0_23_runbook" -runbookfile="10_0_23_runbook.xml"

Then verify the installation:

AXUpdateInstaller.exe list > listcomponentsupdated.txt

Compare listcomponentsupdated.txt with your earlier list to confirm that components have been updated.

Finally, open D365FO in your browser → Settings → About
✅ The new version number should now be visible.


🧰 Troubleshooting Common Errors

🧩 Error: DB Sync Fails (Usually Step 24)

Error Message:

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: System.Management.Automation.RuntimeException: An exception of type System.Net.WebException occurred when making an HTTP request to: http://127.0.0.1/ReportServer.

Cause:
The SSRS (SQL Server Reporting Services) service is stopped.

Fix:

  1. Start the SQL Server Reporting Services service from Services.msc.

  2. Rerun the failing step:

    AXUpdateInstaller.exe execute -runbookid="10_0_23_runbook" -rerunstep=24

Note: The update script sometimes stops SSRS but doesn’t restart it — you may need to manually start it mid-update.


🛍️ Error: Retail Self-Service Update Fails (Usually Step 52)

Error Message:

UpdateRetailSelfService.ps1 failed. Script execution failed. Please find the logs at <path>\UpdateRetailSelfService.log.

Cause:
The Azure Storage Emulator is not running.

Fix:
Start it manually:

"Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start

Then rerun the failing step.

⚠️ Note: In-place updates or deployments of customizations on a locally deployed VHD are not supported. For development or testing, use an LCS-deployed developer topology.


✅ Summary

You’ve now successfully applied the latest Service Update to your D365FO development VM.
To recap:

  1. Download and extract the deployable package

  2. Configure topology and components

  3. Generate, import, and execute a runbook

  4. Verify and troubleshoot any errors

Keeping your development environment current ensures smoother deployments and compatibility with Microsoft’s cloud releases.

Comments

Popular posts from this blog

How to Refresh a Form or Data Source in D365FO Using X++

  Introduction In Microsoft Dynamics 365 Finance & Operations (D365FO), refreshing the form after an action (like inserting, updating, or deleting a record) is essential for keeping the UI updated with the latest data. In this blog, we’ll explore two ways to refresh the form in X++: ✅ Refreshing the entire form using taskRefresh ✅ Refreshing a specific data source using research Let's dive into the best practices for implementing these refresh methods! 🔄 Refreshing the Entire Form If you need to refresh the whole form , use the taskRefresh method. This method is useful when multiple data sources are involved, and you want to reload everything. 📌 X++ Code for Full Form Refresh public void refreshForm() {     // Get the current form instance     FormRun formRun = this.formRun();     // Check if formRun is valid before refreshing     if (formRun)     {         info("Refreshing the form...");     ...

How to Open a Form with Filtered Data Using a Button in X++ – A Step-by-Step Guide

 In Dynamics 365 for Finance and Operations (D365FO), a common requirement is to open a form dynamically from another form and pass filtered data based on a specific condition. This functionality can enhance user experience by allowing them to interact with multiple forms seamlessly, while keeping the data relevant and focused. In this blog, we’ll explore how to implement such a solution using X++, where a user clicks a button on Form 1 (such as a list of sales orders), and based on a selected record, Form 2 (such as invoice details) opens with only the relevant filtered data. Scenario Overview Let’s assume the following scenario: Form 1 : Displays a list of sales orders, and each order has an OrderID , CustomerID , and OrderAmount . Form 2 : Displays details of invoices (from the InvoiceDetails table) that are linked to the selected OrderID from Form 1 . The goal is to click a button on Form 1 , pass the OrderID to Form 2 , and display only the relevant invoice records relate...

Sorting Data in X++ (D365FO) Grids Using Form Data Source Events

  Introduction : In Dynamics 365 Finance and Operations, form grids often display data retrieved from a table or query. However, the default sorting applied may not always align with business requirements. Customizing sorting behavior at runtime ensures that the grid data is presented in a meaningful order for users. This blog post demonstrates how to use the Initialized event of a form data source to apply custom sorting to a grid. We will sort the grid rows based on a specific field ( DisplayOrder ) in ascending order. Understanding the Code : Here’s the complete code snippet: --------------------------------------------------------------------------------------------------------------- [FormDataSourceEventHandler(formDataSourceStr(MyFormDataSource,  MyTable), FormDataSourceEventType::Initialized)] public static void MyFormDataSource_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e) {     // It will clear if any other sorting is applied on the grid ...