This is more of an appropriate use question than an issue. I have been experimenting with complex business objects where a child object is nested within the parent class. The idea was keep the logic for controlling the relationships between objects, like deleting child object’s records when deleting the parent (to avoid foreign key constraints) within the business object and out of the UI. This approach created issues with data binding on the nested object which can be overcome by adding custom properties on the parent to expose the child’s properties. This was actually working pretty well until I upgraded to v1.41 6/6/06 release. With that update I found that I can no longer populate a ListView from a nested object. I now get an error similar to “Could not create and fill the business object of type ‘TestLibrary.Order+LineItemInfo” ( LineItemInfo is nested within the Order class). Is this change in behavior actually a fix?
More importantly is my complex object approach something that I shouldn’t be trying to do with SF? I came to SF from CSLA and haven’t totally adjusted to the one-table-one-object way of thinking where everything gets tied together on a form.
-Larry
Let me know, because something is fishy there...
And yes, you can certainly create complex business objects that contain instances of other business objects... we do.
Attached is the stack trace.
1) Requery(MyBO, BusinessCloneDataType.ClearAndFillFromCompleteTable)
2) Private Sub ListPopulating(...)
e.Parameters(0).Value = MyBO
e.Parameters(1).Value = BusinessCloneDataType.ClearAndFillFromCompleteTable
End Sub
It could also be that even though you're passing the parameters, the business object you're passing might be null (Nothing).
Thanks for the insight on complex objects. It would be helpful if you could provide a more complex example of a complex BO. The original complex example was a ggod intor but it would be nice to have a good 'production' example.