Lists and MarkAsChild

Lists and MarkAsChild

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


vdhant posted on Thursday, January 01, 2009

Hi guys
When adding BO's to a BO list i can't for the life of me find where it sets the items that are being added to the list as child objects (i.e. calling MarkAsChild). Does this mean you should manually call MarkAsChild before you put a BO in the list or am i missing something.

The reason for asking is because BusinessListBase calls child.DeleteChild(); which intern checks to see if the child object being deleted is a child object. But i can't see where it is setting the BO's as children when adding them to the list. Hence it would seem that this should throw an exception all the time unless one manually calls MarkAsChild before adding a BO's to the list.

Cheers
Anthony

daniel_higgins replied on Thursday, January 01, 2009

Hi Anthony,

The BusinessListBase does not MarkAsChild.

You need to construct your child objects as children.... that is, you need to use the Child_Fetch method (which will mark the object as a child), or call MarkAsChild explicity in your constructor (if you are not using the child dataportal stuff).

Copyright (c) Marimer LLC