Question
Cotiviti
US
Last activity: 22 Aug 2024 7:02 EDT
Conditionally launch local action
I want to launch a local action upon click of a button on a flow action but only if there are no client side or server side validation errors but not yet finish the assignment. The assignment would instead finish upon click of submit on the local action. I just dont know how to conditionally launch the local action as i described.
-
Reply
-
Robert Malone -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
@TerranceK5260 The condition check before launching the pop-up is done on the client side. So, you can use a flag, which must be present client side(loaded on the UI), to conditionally launch the modal dialog. In case there are server side validation to run, you can run a DT prior to this and set the flag. In this case, the section has to be refresh for the flag to sent back to the client side
Updated: 15 Aug 2024 9:16 EDT
Cotiviti
US
@kammv So what about the client side validation? How do I determine if there are client side errors? I would need to set this flag when there are client side errors right? How would I do that? Like when I click on submit you get the popup that indicates there are errors so its then that I need to set this flag.
Pegasystems Inc.
IN
@TerranceK5260 As far as I know, you might need to add a js script and call that script on the button. the javascript code should be helpful to add client side errors
Cotiviti
US
@kammvI don't want to addd client side errors. I want to prevent the local action from launching if there are client side errors. I haven't been able to find a way to do that.
Pegasystems Inc.
IN
@TerranceK5260 the first action would be to call the script and set a flag. On the second action, when the local action is configured, you can specify the when condition to check for the flag that was set earlier
Pegasystems Inc.
IN
@TerranceK5260 Correct, and then use that flag in the when condition for launching the local action
Pegasystems Inc.
CA
Would hasMessage when rule suffice your requirement to show the local action conditionally?
Updated: 21 Aug 2024 14:47 EDT
Cotiviti
US
@RameshSangili No. I tried that. For client side errors it does not catch it. There are no messages for client side errors.
Maantic Inc
IN
The when condition on the action set works when the screen first renders. Even if you give hasMessages in the when condition and when the screen first loads there is not message, then the when will fail. After you set any error message, you need to perform a refresh so that the messages are set on the context, then the when hasMesages will work.
Truviq Systems
IN
Hi,
Write the below java script function in harness.
function clearq (status) {if (status === "error") { pega.control.actionSequencer.clearQueue(); } }
Next, you'll configure a Run Activity action where you’ll set up the Page-Set-Messages step. After that, you’ll execute the clearq JavaScript function, then add Local action as below shown picture
Thanks,
Yaswanth