How to customize the message “You are closing or replacing an open work item."
To customize the PRPC-provided message window, "You are losing or replacing an open work item", make sure that the required hotfixes are installed on your system, then override the Field Value pyMessageLabel in your application ruleset with your own custom localized labels.
When you close a work item tab, the WorkFormStandard HTML fragment and the pega_ui_doc.js files provide the localized values for messages in the browser pop-up window.
- The pega_ui_doc.js text file calls the doClose() function, which in turn calls the closeWork() function in the pega_ui_doc.js rule.
- The closeWork() function calls the isFormDirty() function to check if the work form was edited.
The isFormDirty() function looks for the line of code that displays the pop-up message:
confirm(confirm(sMsg1+"\n\n"+ sMsg2 +"TEST \n" +sMsg3))
- If the isFormDirty() function returns
yes, then the appropriate default message is displayed to the user.
Looking at the line of code evaluated by the isFormDirty() function, you can see that the PRPC-provided messages – sMsg1, sMsg2, and sMsg3 – are driven by Field Value rules.
To customize any of the PRPC-provided pyMessageLabel rules that are driven by Field Value rules and evaluated by doClose() calling closeWork() calling isFormDirty(), complete these steps:
- Run the Update Manager System Scanner to verify that the required hotfix is installed on the PRPC system:
- PRPC 6.1 SP2 HFix-3615
- PRPC 6.2 SP1 HFIX-7601
- PRPC 6.2 SP2 HFix-6036
- PRPC 6.3 SP1 HFix-7851
- If the hotfix is not installed on your PRPC system, download it from My Support Portal in the Hotfix Self-Service area, and install it using Update Manager.
- Override the Field Value pyMessageLabel in your application ruleset, specifying your customized Localized Labels for the messages to display when closing a work item tab after editing a work form.
Published July 23, 2014 — Updated October 2, 2015