Enforce Dirty Check modal dialog with Save and Discard button for certain custom text input controls in Pega 24 env post upgrade
Problem statement-
Dirty Check modal dialog with Save and Discard button not appearing for certain text input controls in Pega 24 infinity upgraded env
Description-
we upgraded from Pega 7 to Pega 24 Infinity recently, we noticed that for certain text input controls, we were seeing issue like if user modifies or deletes some information , and user tries to close the tab it doesnot shows the pop up which will say “You are about to discard your unsaved changes” as shown below
solution-
1. create a new javascript text file with below code
if(pega){
if(pega.u){
if(pega.u.d){
pega.u.d.attachOnload (function(){ pega.ui.HarnessContextMgr.set("gDirtyOverride",true); }, true);
}
}
}
2. attach this javascript text file to Harness which holds the section which has those input fields like below