Skip to Content

B1 Service Layer Get a invoice from a order

Jan 08 at 06:41 PM


avatar image

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:


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


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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ivan Carrillo Jan 08 at 09:51 PM

Please, someone help me...

10 |10000 characters needed characters left characters exceeded
Ralph Oliveira
Jan 11 at 10:50 AM

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.

10 |10000 characters needed characters left characters exceeded