Question

Pass When rule with parameter to function IsInPageListWhen

Let's say I have this function call

IsInPageListWhen("crmHasOperatorID", .Recipients)

The above function checks if any page in the pagelist Receipients satisfies the when rule "crmHasOperatorID".

Now, I added parameter to this when rule, say XYZ.

How do I provide the parameter value to the when rule when calling IsInPageListWhen ?

Thanks

Sri

Comments

Keep up to date on this post and subscribe to comments

January 15, 2019 - 5:45pm

if you are calling the function in the DT , try the below approach ,

https://community1.pega.com/community/pega-product-support/question/how-pass-parameters-when-rule-data-transform

Let us know , if it worked.

Pega
January 15, 2019 - 11:34pm
Response to ashokk09

Thanks Ashok. I am calling the function in a WHEN rule. No Data transform or activity involved.

January 15, 2019 - 11:32pm

If you are trying to send the same set of parameters for each of the page in the embedded page list, then it is good enough to set those values in the parameter page before calling the the function.

If you are looking for sending values dynamically for each page in the page context, it is better to make use of the page context within the when rule rather than using params.

Please post an example scenario of the type of param values that you might pass to the when rule to solve it better.

Thanks.

January 16, 2019 - 5:36pm
Response to Ratan

Hi

I have the exact same question but have not come across a solution as of yet.

When you say 'it is good enough to set those values in the parameter page before calling the function' - how exactly do you set the values to the input parameters that the when rule expects?

Thanks,

Shah

January 17, 2019 - 11:41pm
Response to ShahH874

Hello @ShahH874,

When you can a when rule from a function like "IsInPageListWhen", the when rule is executed with each of the embedded page as the context page of the when rule. In such cases, if the parameter to be passed to the when rule changes depending on the context page, then it is better to hold those values in the same page rather than having the values as parameters.

If the param values remain constant for every time the when rule is called, then the param can be set before the when rule.

If the the data needs to be supplied only via params to the when rule, then as @ashokk09 pointed out, call a data transform for each page from within a when rule before calling the function.

Please give me the problem statement/ actual scenario to address it even further.

Thanks.