I’m trying to format a DT-property as “dd/MM/yyy” in my correspondence rule.
Currently in the connector to the “Send email” block, I set a param.TempDate as @FormatDateTime(.DateProperty,“dd/MM/yyyy”,“”,“”) and use the param.TempDate as a pxDisplayText reference in my correspondence rule.
This is working, but probably far from an ideal solution.
I’m able to call the FormatDateTime function directly in jsp, but then, the difficulty is how to get the propertyvalue passed as a parameter to this function. I don’t want to refer hardcoded to pyWorkPage page, it should read the property from the current context.
@Joris Claus You can use a parameterized reference in your correspondence rule to achieve this. First, create a parameter in your correspondence rule, for example, ‘ParamDateProperty’. Then, in the connector to the ‘Send email’ block, set the parameter value as the property you want to pass, like .DateProperty. In your correspondence rule, use the following syntax to format the date:
This will format the date according to the ‘dd/MM/yyyy’ format and use the property value passed from the current context without hardcoding the pyWorkPage reference.
This answer came from a Pega gen-AI assistant using the below references. As a Support Center moderator, I reviewed the answer and references for accuracy: