2

I have 3 objects order, order_lines and shipment_lines . So order has many order lines and many shipment_lines.

So I want to display order_lines and shipment_lines fields on a single related list on order.

In an attempt to make Orders as Junction Object, here's what I found:

  1. I already have a Roll-Up Summary (COUNT Order Lines) on orders with a Master-Detail relationship with master as Orders .

  2. On order_lines I have Lookup to Orders order_number__c

  3. On shipment_lines I have Lookup to Orders shipment_number__c

  4. In the end I created a different object Shipping_order to have MD with shipping lines and order lines(I don't prefer this). But now I have to show this table as related list in order.

Is there any possibility that I can add it to Orders object?

Thanks in advance!

1 Answer 1

1

If you are fairly certain there will be one shipment_line for every order_line, you might want to create your junction object Shipping_Order as a child of Orders then have a M-D between the junction object and shipment_line plus another M-D between the Junction object and order_line. I believe that will provide you with the single related list you're looking for while also supporting the roll-up summary counts. I don't think the Junction Object will need to have a M-D relationship with Orders unless you first break the existing one between Orders and order_line.

I'm not certain how well this will work for you if there isn't a shipment_line for every order_line. There may be some sorting issues between the two of them regardless that you'll need to resolve with trying to match between them.

Edit I gave this some further thought and believe your Junction Object - Ship_order should be in a M-D relationship with Orders. In that way when an Order record is deleted, the related Junction Object record will be deleted along with the related order_line and shipping_line since they'll be in M-D relationships with the Junction Object, making them grandchildren of Order. There are valid reasons for all abject to be in M-D relationships and that should be given consideration.

1
  • Thank you for your response. I'm trying to relate the junction object to the orders object.
    – MnZ
    Sep 13, 2014 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .