Skip to main content

Posts

🔎 How to Get Line-wise Other Charges Tax Amount in D365FO (IGST / CGST / SGST)

 In many D365FO implementations (especially India GST projects), we often need: Line-wise Other Charges Tax Amount Split into IGST, CGST, and SGST For Posted Customer Invoice Lines (CustInvoiceTrans) By default, D365FO stores: Invoice Lines → CustInvoiceTrans Charges → MarkupTrans Tax → TaxTrans To get accurate charges tax per invoice line, we must follow proper table relation hierarchy. 📌 Table Relationship Structure CustInvoiceTrans → MarkupTrans → TaxTrans Relationship Logic: MarkupTrans.TransTableId == tableNum(CustInvoiceTrans) MarkupTrans.TransRecId == CustInvoiceTrans.RecId TaxTrans.SourceTableId == tableNum(MarkupTrans) TaxTrans.SourceRecId == MarkupTrans.RecId This ensures we fetch only Charges Tax , not Item Tax. 🧠 Business Requirement For each invoice line, we need: IGST Amount CGST Amount SGST Amount Converted to positive value (if negative) 💻 X++ Code – Line Wise Charges Tax Calculation Cus...

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

Calculating Managed Cost Site-Wise in Dynamics 365 Finance and Operations using X++

    /**      * Calculate the managed cost for a given item and site.      *       * @param _itemId The ItemId for which the managed cost is to be calculated.      * @param _siteId The SiteId for which the managed cost is to be filtered.      *       * @return The calculated managed cost for the given site.      */     private real calculateManagedCostBySite(ItemId _itemId, InventSiteId _siteId)     {         Query                        query;         QueryRun                     queryRun;         QueryBuildDataSource         inventSumDS, inventDimDS, inventTableDS;         InventSum            ...

Integrate API using X++ in D365FO

 Process of making a POST request in X++ using the WinHttp class step by step. 1. Setup Before making an HTTP request, ensure you have the necessary URL, headers, and payload data you want to send. 2. Create the HttpWebRequest Object You will first need to create an instance of HttpWebRequest by specifying the URL you want to send the POST request to. 3. Configure the Request Set the HTTP method to POST and configure any necessary headers and content type. Prepare the request body as a byte array. 4. Send the Request and Handle the Response Write the request body to the request stream, send the request, and read the response. Example Code Here’s a detailed step-by-step example in X++: static void PostRequestExample(Args _args) {     System.Net.HttpWebRequest request;     System.Net.HttpWebResponse response;     System.IO.Stream requestStream, responseStream;     System.IO.StreamReader reader;     System.Text.Encoding utf8;  ...

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

Customizing Date Lookup to Use the Persian Calendar in D365FO (X++)

Introduction Dynamics 365 Finance and Operations (D365FO) traditionally uses the Gregorian calendar for date selections. If your organization requires the Persian calendar, you can customize the default date picker form, SysDateLookUp, to accommodate this need. This blog provides a detailed guide on how to achieve this, including the creation of necessary classes and methods for date conversion. Step-by-Step Guide 1. Duplicate the SysDateLookUp Form To begin, you need to create a copy of the existing SysDateLookUp form, which will be customized to use the Persian calendar. Action : In the Application Object Tree (AOT), locate the SysDateLookUp form, right-click it, and select "Duplicate." Name the new form : PersianDateLookup 2. Configure the Persian Calendar Open the Form : Navigate to the AOT, find the duplicated PersianDateLookup form, and open it. Modify the Init Method : Open the init method of the PersianDateLookup form and set the calendar type to Persian. Use a util...

Configuring a Secure Connection to D365FO in OneBox

  Introduction In this guide, we will address how to eliminate the “Not secure” message that appears in the URL bar when connecting to Dynamics 365 for Finance and Operations (D365FO) in a local development environment known as OneBox. We will explore why this issue arises and provide a step-by-step solution to fix it. Understanding the Issue The problem originates from the site certificate not meeting the latest security standards. Google Chrome, starting from version 58, uses only the subjectAlternativeName extension, not the commonName , to validate the domain name against the site certificate. This change means that if the certificate does not comply with these standards, Chrome will flag it as invalid. Although Internet Explorer (IE) is less strict and may not show this warning, the issue is significant for Chrome users. More information can be found at this link: Google Chrome Security Support . Solution Steps Step 1: Generate a New Self-Signed Certificate To address this is...