Parent Data in Grandchild object

Parent Data in Grandchild object

Old forum URL: forums.lhotka.net/forums/t/4193.aspx


SomeGuy posted on Friday, January 18, 2008

I'm working on a Purchase Order object and associated child collection of Purchase Order Detail objects.

The PO has a Vendor associated with it, and there are Products that are associated with the Vendor. The

Vendor Products also have information like Max and Min Order Quantities, etc.

What is a good way to validate the PO Detail data (ie Order Quantitiy). How do I get the Vendor ID at the detail level in order to look up the Vendor Product and it's properties. Thanks.

E

 

Dawn replied on Friday, January 18, 2008

you can write a property on child collection reference to PO,  mark it NotUndoable, NonSerialized, when child collection create and PO OnDeserialized, set it to reference the PO.
Then PO Detail can cast it's Parent property to the child collection, you'll get the Vendor ID from PO.

Copyright (c) Marimer LLC