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.
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.