web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Link CustInvoiceLine table and TaxTrans Table

(0) ShareShare
ReportReport
Posted on by 435

Hi There,

I am Creating a report which bring Tax Amount for Free Text Invoices, but i cant find the relation in between CustInvoiceLine table and  TaxTrans Table.

Kindly help me to how to link the above tables

Thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You can check the method displayTaxAmount of table CustInvoiceLine to see how table custInvoiceTable & taxTrans are related and how tax is getting calculated. Below code provides you the required relationship.

    static void AXC_CustInvoiceTable(Args _args)
    {
        CustInvoiceTable custInvoiceTable;
        TaxTrans         taxTrans;    
        CustInvoiceTrans custInvoiceTrans;
        CustInvoiceLine  custInvoiceLine;
        
        while select  taxTrans
            join LineNum, InvoiceId, InvoiceDate, RecId from custInvoiceTrans
                where taxTrans.SourceRecId == custInvoiceTrans.RecId
                    && taxTrans.SourceTableId == custInvoiceTrans.TableId
            join custInvoiceLine
                where custInvoiceTrans.LineNum == custInvoiceLine.LineNum 
            join custInvoiceTable
                where custInvoiceTable.RecId  == custInvoiceLine.ParentRecId
                    && custInvoiceTrans.InvoiceId == custInvoiceTable.InvoiceId
                    && custInvoiceTrans.InvoiceDate == custInvoiceTable.InvoiceDate
        {
            info(strFmt("InvoiceId: %1, TaxCode: %2", custInvoiceTable.InvoiceId, taxTrans.TaxCode));
        }
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans