I have attached a screenshot of the schema. I have order, order_lines and shipment_lines related as in the following picture...
Is it mandatory to create a junction object to get shipment lines for a particular order line?
Thanks in advance!
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You can use the existing objects and relationships e.g. like this:
select Id, ... from ShipmentLine__c where Shipment__c in (select Shipment__c from OrderLines__c where Id = :orderLineId) order by ...
so in general no you do not need to introduce another relationship/junction object.
Here is a good article on the subject of A Deeper look at SOQL and Relationship Queries on Force.com.