Parent BO method that need to access child BO


Author
Message
Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I want to create public method to calculate order total in OrderBO. It will sum up line items subtotal by loop thru LineItemsBO datarows. The method will be called before OrderBO.beforesave() event.



My problem is, how could I access child BO - LineItemsBO in OrderBO? I can't set LineItemsBO to ParentBusinessObject property at OrderBO component designer.



Any ideas?



Thank you
Chan
Chan
Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)Advanced StrataFrame User (723 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Any feedback on this?

Thank you

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Since the OrderBO is the parent of the LineItemBO (many lines items belong to an order), you'd set the parent relationship of LineItemBo to be an OrderBO in the LineItemBO designer. Then when using instances of these, you'd set the parent BO of a line item to the specific instance of the OrderBO. However, I pretty sure there isn't a way to set a child BO in the parent. However, you could create a custom property in the OrderBO:





Private _itemsBO as LineItemBO

Public Property ItemsBO() As LineItemBO

Get

Return _itemsBO

End Get

Set(value as LineItemBO)

_itemsBO

End Set

End Property



This should show up on the properties window of your BO. Then you can set it and use it in your method. I hope I've understood the problem and that this is helpful.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search