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


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks for the info.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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?


Edhy Rijo

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