Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Cancel button behaviour

SA-20496

Summary



User wants to rectify the Cancel button behaviour for the following scenarios.

1) If there are some unsaved changes, confirmation dialogue should be shown.
2) If there is some incorrect input user shouldn't be presented with validation messages as he or she cancels input data.
3) All unsaved data should be discarded.
4) After cancelling local\flow action user should be presented with current work item and not closed.

Steps to Reproduce



Scenario 1
1) Run local action.
2) Make some changes by editing fields.
3) Cancel action by invoking Review action assigned to Cancel button.
4) Review harness opened.
5) No warning message about unsaved changes.

Scenario 2
1) Run local action.
2) Make some changes by editing fields.
3) Cancel action by invoking Cancel action assigned to Cancel button.
4) Confirmation dialogue about unsaved changes is shown.
5) Click button with Cancel action assigned.
6) Confirm work item is closed.


Resolution



 
  1. Deploy HFIX-23425 via DL-53700. Ensure to take database backup before deploying the HFIX.
  2. Post deploying the HFIX make the following changes
    1. Create a JS file with the below code and attach the JS script in your harness
var cancelFlowAction = function(skipDirtyCheck, WOKey,ev){
 
  
                if(skipDirtyCheck === "true"){
                pega.u.d.gDirtyOverride = false;
                                openWorkByHandle(WOKey,"","","","true","true");
                }
                else if(explorerFormIsDirty()){
                                pega.u.d.queueDirtyModalAction(ev);
                //pega.u.d.showCustomDirtyModal();
                }
                else{
                                pega.u.d.gDirtyOverride = false;
                openWorkByHandle(WOKey,"","","","true","true");
    }
};
  1. Configure CANCEL button :
function name = "cancelFlowAction"
Parameters
skipDirtyCheck = false
= .pzInsKey
= script:event
  1. Configuration for Discard button
    Harness
    Replace Current
    Tab Name = 1
    Class = MyCo-FW-MyAppFW-Work
    Harness = Review
    Read Only = Yes
    Submit Current = No
    Activity = One step activity = Obj-Open-By-Handle for Primary page (in order to discard clipboard changes)
 
  1. Step 3: Clear browser cache.

Published March 5, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us