cancel
Showing results for 
Search instead for 
Did you mean: 

B1 Service Layer Get a invoice from a order

Former Member
0 Kudos

Hi everyone!

I have a question about the relationship between Orders and Invoices... In oficial SL documentation i can see about how to know the invoices from a particulary client knowing for example a order....The example is like that:

Orders(1)/BusinessPartner/Invices

The problem is... I need to know the invoice from base order... Something like this...

Orders(1)/Invoice

I dont know how to do that relation... i can see a "BaseEntry" in database, but that value is not in the SL queries

Thanks a lot for your time and support, regards.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member197733
Contributor
0 Kudos

Hi Ivan,

The relationship between Orders x Invoices is done by the Order's Lines.

That means Orders(1)/Invoice makes no sense, as the lines of Order #1 might be linked to many different invoices.

The link is not only done by the DocNumber (BaseEntry) but also by the Type of the Document (BaseType).

All of that to explain you why the association approach you are trying to do won't work.

I see a couple of ways in your case:

Option #1: Implement a SL Script Engine code that could gather all the Invoices generated for a given order.

Option #2: Encapsulated the invoice query in Calculation View (preferred Graphic) and exposed it via a Odata service.

Former Member
0 Kudos

Please, someone help me...