How to check if BO has children ?

How to check if BO has children ?

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


lukky posted on Tuesday, January 20, 2009

Hi,

Maybe I'm missing it, but I can't find a way to verify, at runtime, if a BO has child BO properties.

I would think of a HasChildren or IsParent property, but it's not there.

Thank you.

rsbaker0 replied on Tuesday, January 20, 2009

If you are using managed properties, then you can call FieldManager.GetChildren() to get a list of child objects.

If you aren't using managed properties, you could probably achieve something similar (although at much greater expense) by reflecting on the object properties and see if they implement interfaces that are unique to child objects (e.g. IUndoableObject)

lukky replied on Tuesday, January 20, 2009

Hey thanks a lot.

I do use managed properties, so FieldManager.GetChildren() does the job.

Party!!! [<:o)]

Copyright (c) Marimer LLC