Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Configuring confirmation modal dialog boxes

Updated on December 13, 2022
Applicable to Theme Cosmos applications

Ensure that users do not unintentionally lose work by configuring confirmation modal dialog boxes (dirty forms) that web browsers display natively. For example, after a user changes a name in a case and tries to close that case, the system displays a modal dialog box with a message that unsaved changes might be lost.

Pega Platform supports two types of confirmation modal dialog boxes: the default dirty form and the natvie browser dirty form.
Default dirty form
The default dirty form with the options to cancel, discard, and save the work.
Native browser dirty form
The native browser dirty form, with the options to cancel or confirm the action.

Dirty forms are displayed when users makes changes in the current rule, and then try to navigate away or close that rule. The default modal dialog box gives the option to discard the changes, save the changes, or cancel the attempted action and remain in the current rule. When users work on a work object, and then try to use a local action (for example, an option on the Actions menu), the dialog box is displayed, but the save option might not work as intended. By configuring the native browser dirty form, you prevent that situation.

  1. In the header of Dev Studio, search for and open the UserWorkForm HTML Fragment rule.
  2. On the HTML tab, in the HTML Source section, in the script tag, set the pega.u.d.bUseNativeDirtyConfirm flag to true, as shown in the following code snippet:
    <script> pega.u.d.bUseNativeDirtyConfirm = true </script>
  3. Optional: To enable confirmation dialog boxes for frameless portals with work items that include Post value or Refresh local actions, perform the following actions:
    1. Set the pega.u.d.handleDirtyForFramelessPortals flag to true.
    2. Add a function to execute during refresh, as shown in the following code snippet:
      function confirmationBox() {
       pega.ctx.ignoreDirtyState = false;
    3. For the control that triggers the refresh, configure a Run script action that calls the confirmationBox function defined in step 3.b.
  4. Click Save.

Have a question? Get answers now.

Visit the Support 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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us