Skip to main content

๐Ÿ”„ Convert Available Inventory to Kilograms (KG) in X++ – D365 F&O

When working with raw materials in Dynamics 365 Finance & Operations (D365 F&O), it’s common to encounter situations where the inventory is stored in one unit (like Liters or Packs), but needs to be viewed or calculated in Kilograms (KG) for costing, reporting, or analysis. In this blog, we’ll walk through a practical X++ code snippet that demonstrates how to convert available inventory (AvailPhysical) into KG using D365’s standard Unit of Measure (UOM) conversion. ๐Ÿ“Œ Business Scenario Suppose you have a chemical item stored in Liters , but the production or costing team needs to see its available inventory in KG . You’ll need to: Fetch the item’s AvailPhysical from the InventSum table. Get the current unit of measure (UOM) for the item. Convert that quantity into KG , based on predefined unit conversion. ๐Ÿ’ป X++ Code – Inventory Conversion to KG Here’s the code block that does exactly that: //******************** Avail Physical as per KG Unit conversion *...

Converting Windows Server Evaluation to a Full Version

 Microsoft offers trial versions of Windows Server, such as StandardEvaluation or DatacenterEvaluation, for users to explore the platform’s features. These evaluation editions are available for download from the Microsoft Evaluation Center and are intended for testing, training, or evaluation purposes, not for commercial use. Once installed, these evaluation versions provide a 180-day trial period to assess the system’s capabilities.

If you find yourself using an evaluation version for production purposes, you can upgrade it to a full version without losing your data or needing to reinstall the operating system. This guide walks you through the process of extending the evaluation period and converting your Windows Server Evaluation edition to a full retail version.

Extending the Windows Server Evaluation Period

When using an evaluation version of Windows Server, the desktop will display the current edition and the remaining trial period. To check the time left on your evaluation period, you can run the following command:


slmgr /dli

This command will display the current status of your license and the time remaining before it expires. If you need more time to evaluate the system, you can extend the trial period up to five times, adding 180 days each time. Use the following command to extend the period:


slmgr /rearm

This means that, in total, you can use the evaluation version for up to three years.

After the trial period ends, Windows Server will begin to shut down every hour, and you’ll see warnings in the Event Viewer, such as:

  • Event ID: 1074: The system has been shut down because the license period expired.
  • Background and Notification: The desktop background will turn black, and a notification will appear stating that the Windows License has expired.

Upgrading Windows Server Evaluation to a Full Version

To upgrade from an evaluation version to a full retail version, follow these steps:

  1. Verify the Installed Edition: First, confirm that you are running an evaluation version:


    DISM /online /Get-CurrentEdition
  2. Check Upgrade Options: Determine which editions you can upgrade to by running:


    DISM /online /Get-TargetEditions

    This will list the editions available for upgrade, such as ServerStandard and ServerDatacenter.

  3. Obtain the GVLK Key: To proceed with the upgrade, you need the Generic Volume License Key (GVLK) for your target edition. Microsoft provides these keys for all supported Windows Server versions, such as:

    • Windows Server 2022 Standard: VDYBN-27WPP-V4HQT-9VMD4-VMK7H
    • Windows Server 2022 Datacenter: WX4NM-KYWYW-QJJR4-XV3QB-6VM33
  4. Upgrade Using DISM: Use the DISM command to convert your evaluation version to a full retail version. Replace the placeholder with your GVLK key:

dism /online /set-edition:ServerStandard /productkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /accepteula


  • If upgrading to Datacenter, change the set-edition parameter to ServerDatacenter.

  • Restart the Server: After the process completes, restart your server to apply the changes.

  • Activate the Server: If you have a local KMS server, activate your Windows Server using:


    slmgr /skms <KMS_Server_Name>:1688 slmgr /ato

    For a MAK or retail key, remove the current GVLK key and enter your retail key:


    slmgr.vbs /upk slmgr.vbs /cpky slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX slmgr.vbs /ato

    Verify the activation status using PowerShell:

  • Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select Description, LicenseStatus

  • Common Issues During the Upgrade

    While converting your evaluation version, you may encounter errors such as:

    • Error 1168: This indicates that you entered a retail or MAK key instead of a GVLK key. Always use the GVLK key during the upgrade process.
    • Upgrade Path Restrictions: You cannot downgrade from Datacenter to Standard during an upgrade, and conversions on domain controllers are not supported.
    • Error: 50: This error often occurs if the Active Directory Domain Services role is installed on the server.

    By following these steps, you can successfully convert your Windows Server Evaluation edition to a full retail version, ensuring your server continues to run smoothly without interruptions.

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