StrataFrame Forum

Best practice to refer to a BO property in a BO function?

http://forum.strataframe.net/Topic23398.aspx

By Edhy Rijo - 6/6/2009

When creating functions and methods in a BO, sometimes you may need to use a BO property like BO.FirstName but at the same time, check for BO.Count > 0 must be done, I know that we can also refer to the property using Me.CurrentRow.Item(Business.bizItems.bizItemsFieldNames.FirstName.ToString).



So my question is, which one is better to use and why?
By Trent L. Taylor - 6/7/2009

So my question is, which one is better to use and why?

Well, I don't know that I totally understand your question because in this example they are doing the same thing.  If you refer to the CurrentRow without a row being present, you will get a CurrentRowIndex < 0 exception.  In short, all references from within the BO in this example use the CurrentView (including the CurrentRow) as the CurrentRowIndex property is based off of the CurrentView.  The Count property also comes from the view, so in this example, all paths lead to using the CurrentView of the BO.

By Edhy Rijo - 6/7/2009

Thanks for the info.