How to achieve Pass by reference either in activity or data transform
Hello every one,
I want to achieve the Pass by reference feature either in Activity or DataTransform.
Below is my requirement.
In the section -> UserName filed (Autocomplete) - Action set - Refresh This Section - I will be calling either a data transform or activty for which i will be passing the propertyname and property value.
Ex : SetUserName with parameters FieldName ="UserName", FieldValue ="ABC". By the way this is a clipboard property.
So inside the activity or data transform, i want to modify the Property Value to "DEF" using the passed in parameter name ie; FieldName
Reason : i want to call the same activity/data transform on the other similar fields in the section where the logic inside the rule is same from whereever i call this activity or data transform.
Of course I achieved this using the Java code inside the activity some thing like below which i don't want. I want to go for OOTB functions.
String PropertyName=tools.getParamValue("FieldName"); -- this will give the name of the property
myStepPage.putString( PropertyName, "DEF" ); -- this will modify the property with value "DEF"
localFieldValue = tools.getProperty(PropertyName).toString(); this will assign the new value to a local variable.
After doing a lot of search in the PDN, i got one function through which i can get the value of the passed in parameter name something like below
Set localValue = @pxRuleManagement.pxGetPropertyValue(myStepPage, Param.FieldName)
Here Param.FieldName is the propertyname which i passed.
Similarly i want a function to modify the value using the passed in parameter name.
In short & sweet the requirement is like this... There is an autocomplete field where the user will be entering some value and if the user is not selecting the value from suggestion i want to clear the value and forcing the user to search or select from the suggestions.
I have lot of fields like this in the section. I don't want to write this validation for each and every field.
I want to customize in such a way either one activity or data transform with PropertyName(mandatory) and PropertyValue(optional) as parameters and do the modification inside the rule based on some condition whether the value exists or not.
Please help me with your valuable suggestions if you have come across this kind of requirement.
If you are sourcing the Autocomplete using Data Page, then we can Pass the DataPageName , propertyName , and propertyValue as parameters for a data transform. In the DataTransform use the utility function IsInPageList(PegaAPI,String.String,ClipboardProperty) to evaluate the value is present in the pagelist or not, if the value is not present throw the error.