Question
How to call getPropertyField function to dynamically pick a value
Hi,
Based on a business rule I am trying to pick a property from customer data class. In order to do so, I am calling getPropertyField function to get the related property's value. It's signature is getPropertyField--(String,String,String,PublicAPI)
and called like this @Utilities.getPropertyField(strClassName,strPropertyName,fieldname,tools).
And this is how I call it; @Utilities.getPropertyField("NBAFW-Data-Customer","SegmentKodu","SegmentKodu",tools), it always returns null. As per documentation function "Returns the value of the named property (fieldname) in the Rule-Obj-Property instance that defines the specified property (strPropertyName) in the named class (strClassName).".
Usage of strPropertyName and fieldname is not clear to me. They sound to be the same thing. I appreciate if somebody can show me the right usage of the funciton or a different way of accesing a property's value.
Regards,
Oğuz
p.s. Pega 7.2 & Pega Marketing 7.13
***Updated by Moderator: Marissa to update categories***
Does this help in your scenario?
tools.getProperty("propertyname").getStringValue();