How can I use "tools" in Function rule
I simply want to reference to Data Page within Function rule. In my understanding, in Edit Validate I used to use tools.findPage as below and it worked.
String WorkGroup = ((tools.findPage("D_AppExtend").getProperty("ClassName")).getStringValue());
However when I try the same in Function rule, I can't save - system is complaining "tools cannot be resolved". How can I use tools in Function rule? Do I need to do some declaration at the beginning of the steps?
You could try the following to get the tools initialized properly inside a rule utility function:
PublicAPI tools = ThreadContainer.get().getPublicAPI();
Hope this helps!
Keep up to date on this post and subscribe to comments
- What is "tools" in pega?
- GRID Sort/Filter tool not working displaying "Can not render section". Tracer "Current user is not authorized for privilege 'pyShowClientTimer' for Rule-Obj-Class @baseclass."
- Not able to use tools.getSystemSettings() inside function rule
- After Upgrade all Rule-PegaQ-Questionnaire instance are failing with one error "Failed to find instance 'CheckDuplicatesInPageList--(Clip2a26f277465164f5fef07a9673e2c04d' of type Rule-Utility-Function defined in 'pegasurvey_pegasurveyutilities'"
- Need to know the definition of this OOTB function/script rule: "selectThisProp", as it needs to be called explicitly in a scenario where its not executing OOTB