Question
Accenture
JP
Last activity: 21 Oct 2018 22:32 EDT
Run Script condition by acitivity result
Hi team
Here is our requirement. When user clicks one button, current harness will be refreshed and an activity will run while the refreshing. After refresh, we need to decide whether to run a Java Script function by the result of activity.
We tried to add action set has an Click event and do Refresh-Current-harness action then do Run Script action with a when codintion, but Run Script action will be exeuted before activity finish, so script function will not be exeuted by the result of activity.
Could anyone has adivse about how to achieve this?
Thanks
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Accenture
JP
When rule on button actions would consider property values only from Document Object Model (DOM) and not from clipboard.So I created a hidden property on the same section and refresh section to set the property value. Below link's solution works well.
https://community.pega.com/support/support-articles/local-action-running-all-conditions-0
CollabPartnerz
IN
Could you please share the screen shots how you have configured.
Pegasystems Inc.
IN
HI Shubhi,
Order of the Action-Event items matters while executing the actions on a button. As requested by Raveendra, Can you please send us the complete configuration screen shots.
Accenture
JP
Thanks for your reply!
We configurated button actions like below, refresh current harness with an acivity to do validation and save. If validation failed then need to run script.
In this way Run Script action execute immediately rather than waiting the activity finish.
Accenture
JP
Uploaded screenshots as attachments.
-
Manisha Mahure DO QUANG HUY Rakhi Motwani Rajendrababu Vadlamudi
CollabPartnerz
IN
If possible can you share config details.
Vodafone
IN
Hello Subhi,
This will not work with runscript (as there is an issue with when condition for runscript), you can go for data transform with when condition. If you are custom javascript logic doesn't suits to datatransform, refresh the section after activity, validate the when rule availability, pass the when rule as a parameter to custom script function and validate.
Regards,
Naveen
Accepted Solution
Accenture
JP
When rule on button actions would consider property values only from Document Object Model (DOM) and not from clipboard.So I created a hidden property on the same section and refresh section to set the property value. Below link's solution works well.
https://community.pega.com/support/support-articles/local-action-running-all-conditions-0