Choosing a property of type businesslayer based on the name as a string


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
This is one of those things I do instinctively in Fox with Eval() or & and don't quite have the hang of yet in .NET



I have a number of private properties of type businesslayer



_Endorsements

_Premises

_GL

_Propmaster





I get a name ( but getting the displayvalue of an enum BOName ) of a business object.



The properties are named _



Now I want to look at the count of the BO based on the string which have representing



Dim varname as String = "_" & MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue(bo.BOName)



Lets say varname = "PROPMASTER"



Now I want to get the count of whatever BO is in the property which is in the string varname



i.e. Propmaster.count





Fumbling with syntax here. Appreciate any guidance.



TIA

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Charles,



Glad you found something that works, even though I still don't understand your logic on this one, but if it works that is what matters Tongue



Just to be on the safe side, I noticed that the function or your code does not have any error trapping (TRY/ENDTRY) probably you won't need it, since it looks like those "_" properties are in your base form class, but if for whatever reason a couple of months from now something changes and the property can not be found, your function will return Nothing and your code may fail when you try to access the BO.Count property.

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