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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

ER relation Sales Header vs Generated invoice

(0) ShareShare
ReportReport
Posted on by 52

Hi There,

I'm looking for a way to relate the Sales order with the generated invoice. I would expected a relation between Sales Header and Sales Invoice Header table, but cannot establish a relationship between them. Any help much appreciated!!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    It *can* be a 1:n relation, in this case "Order No." is filled in in sales header. But that's not necessarily the only possible relation. For invoices you can also combine shipments, and then the relation is shipment no. -> order no. in the shipment header. Not sure if these fields are also filled in if there is warehousing in the equation, needs to be checked.

  • blom0344 Profile Picture
    52 on at

    I would expect a link within the invoice header to the sales header. I'm trying to establish which part(s) of all orders are already invoiced. I can relate the CustomerLedgerEntry table to the salesinvoices, which gives information on invoices themselves. However if multiple invoices can be created for one order I would expect a reference value stored in the invoice header pointing to the parent value in sales orders

  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    No that's not the case. There are fields for your use case, though. These would be:

    Quantity Shipped

    Quantity Invoiced

    Qty. Shipped not Invoiced

    Outstanding Quantity

    and relating amount fields, and relating fields in base storage units. These are automatically updated on the posting of an invoice. They are all in the sales line of the order.

  • blom0344 Profile Picture
    52 on at

    I'll look into the fields you mentioned. But still if these fields are updated from the invoice perspective, a form af relation  should exist. Perhaps not through a regular fk-PK relationship?

  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    Yes, there is. It's encoded into Codeunit 80. Depending on which path is used, sales lines are updated directly or indirectly.

  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    For Linking Sales Order to Sales Invoice You need to go through the Sales Shipment header as Order No stored in Sales Shipment Header.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans