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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Relationship between CustInvoiceTrans and CustInvoiceLine

(5) ShareShare
ReportReport
Posted on by 317
I would like to understand the relationship between CustInvoiceTrans and CustInvoiceLine in D365 Finance & Operations.

How are these two tables linked?
Categories:
I have the same question (0)
  • Suggested answer
    Sagar121 Profile Picture
    1,151 Super User 2026 Season 1 on at
    Hi,
     
    Check relation b/w CustInvoiceJour - CustInvoiceTable first. Then link CustInvoiceJour with CustInvoiceTrans.
  • Statics 365 Profile Picture
    317 on at

    Hi, thank you for the suggestion.

    For the relationship between CustInvoiceJour and CustInvoiceTable, I’m currently using the standard method:

     
    custInvoiceJour.custInvoiceTable()
  • Statics 365 Profile Picture
    317 on at

    At the moment, my report uses CustInvoiceTrans as the main data source for the line section, and almost all required fields come from CustInvoiceTrans.

     

    However, there is one specific field I need, which is CustInvoiceLine.InvoiceTxt.

    That’s why I’m trying to understand how CustInvoiceTrans can be linked to CustInvoiceLine, if such a relationship exists.

     

    Thanks in advance for any clarification.

  • Verified answer
    Statics 365 Profile Picture
    317 on at

    At the moment, I’ve implemented a separate logic based on the document type:


    • For Free text invoices, I retrieve line data directly from CustInvoiceLine, linked by

      custInvoiceLine.ParentRecId == custInvoiceJour.custInvoiceTable().RecId.

    • For non–Free text documents (such as Sales Credit/Debit Notes), I retrieve line data from CustInvoiceTrans.


    •  

    This approach avoids the need to explicitly link CustInvoiceTrans with CustInvoiceLine and fits my reporting requirement.

  • Suggested answer
    Sohaib Cheema Profile Picture
    49,659 Super User 2026 Season 1 on at
    Hi,
     
    A few basics 
    CustInvoiceTrans (Posted Invoice Line)
    CustInvoiceLine(Free text invoice line data)
     
    And further you can see the relationship between the two 
    CustInvoiceTrans.CustInvoiceLineIdRef == CustInvoiceLine.RecId
     
    If you want to drill back to, Sales Line from the CustInvoiceTrans (Posted Invoice Line), you can use the inventory reference as follows
    SalesLine::findInventTransId(CustInvoiceTrans .InventTransId, _update);
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 590 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 349

#3
Diego Mancassola Profile Picture

Diego Mancassola 263

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans