cancel
Showing results for 
Search instead for 
Did you mean: 

Referencing the Property Name in its own formula

Community Manager Community Manager
Community Manager

The following returns the name of the property whose formula is getting executed. It only works for Standard and ValidValues formulae:

 

   Result = Me.CurrentProperty.ObjName

 

Note:  When used for ValidValues the result will consist of the property name concatenated with "_ValiValues".   To trim "_ValidValues" from this result:

 

Dim propName As String = Me.CurrentProperty.ObjName
Result = Split(propName, "_")(0)

 

Comments
Experimenter
Experimenter

Hi, Tony.

It works fine for the Standard formulae. But If I'm trying to get the property name from the ValidValues using Me.CurrentProperty.ObjName (or Name) I'm getting "PropName_ValidValues", where the PropName is the property name. Then I need to work with this string to exclude "_ValidValues" from it.

Dim propName As String = Me.CurrentProperty.ObjName
Result = Split(propName, "_")(0)

Is there any way to get property name from ValidValues directly?

 

Thanks

 

Kirill

Community Manager Community Manager
Community Manager

Thanks to Kirill_EI for the update to the article with regards to ValidValues.

Experimenter
Experimenter

I've used that

 

System.Reflection.MethodBase.GetCurrentMethod.Name

 

It gives you the function name. Rulestream property formula function is usually Formula_<propertyName>

 

This is a better way to get it. Thanks. 

Contributors