Skip to main content

Posts

Showing posts from October, 2024

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

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