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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Sales invoice line and GL Entry

(0) ShareShare
ReportReport
Posted on by 65

Hello guys,

I would need to make a statistic that takes information from the table of registered sales invoices (Sales Invoice Line (113)) related to the G / L Movements table (G / L Entry (17)).
I need to relate each row of the invoice line with the g / l entry as we have extended the two tables and with a powerbi report I should expose the information correctly.
Currently I have not been able to find a table that relates the row of table 113 to table 17. The relationship is easily identifiable by header. For the rows I can't find a relationship between the two tables.

Can you tell me what the relationship table is?

Thanks for your help

dm

I have the same question (0)
  • Suggested answer
    Alessandro Vannini 1 Profile Picture
    on at
    RE: Sales invoice line and GL Entry

    Hello D, Monti

    the relation between table 17 and sales is in the sales header, so you need to build a report that read info from the three tables.

    In standard we don't have this solution

    Hope this help

  • Suggested answer
    DonovanDynamics Profile Picture
    10 on at
    RE: Sales invoice line and GL Entry

    I am not aware of a link between the Sales Invoice Line table and the G/L Entry table.  This is one reason why unique document numbers across all posting, journals, document types, etc. are important.  Many areas of the system rely on unique document numbers.  Such as the "Find Entries" or the old "Navigate" function.  You'll see this function works by Document Numbers and Date.  If your Purchase Invoices and Sales Invoices use a generic XXXXX numeric number you will have duplicates across every posting.  It's best to include PSI (Posted Sales Invoice), PPI (Posted Purchase Invoice), etc. in the document number.  Also, use a number series for general journals.

    In regards to linking these transactions, there are some links between transactions created upon posting.  The G/L Register page will show you these.  Each time you post something in the system a G/L Register is created.

    The link between the G/L Entries created and the Customer Ledger Entry created is the Transaction No.

    The link between the G/L Entries created and Item Ledger & Value Entries is the G/L - Item Ledger Relation table.  This table also stores the G/L Register number.

    Unfortunately these linking fields do not exist on posted document header or line tables.  However from the posted document header/lines table you can get to the Customer Ledger Entry or Vendor Ledger Entry table where you can find the Transaction No.  With this Transaction No. you can find all the G/L Entries that were created when this document was posted.  With those G/L Entry numbers you can find the G/L Register that was created at the time of posting.  With that G/L Register number you can find all the entries in the G/L - Item Ledger Relation table which will allow you to get all the Item Ledger and Value entries.

    So you'll definitely have to join in a few tables.

    The other thing to consider when trying to incorporate Value Entries is that additional Value Entries can get created over time due to cost adjustments and/or Item Charges.  These new Value Entries will have been posted in a new G/L Register and will therefor have a new Transaction No.

    Utilizing the above method will only find Value Entries that were created during the original posting.  You'll need to incorporate into your report code to account for newly created Value Entries if you plan on reporting on cost.

    Although with strictly unique document numbers you can reliably use document numbers.

    Another thing: I just noticed that you want to relate each individual Sales Invoice Line to its corresponding GL Entries.  This won't always be possible as the system will post single entries into certain accounts for different reasons.  You will probably only get one Accounts Receivable entry even if you have 10 lines on the invoice for example.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,750

#2
Sumit Singh Profile Picture

Sumit Singh 2,689

#3
YUN ZHU Profile Picture

YUN ZHU 1,987 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans