Skip to main content

Table of Contents

Customizing harnesses globally with JavaScript


Only available versions of this content are shown in the dropdown

Customize all harnesses in your application by modifying the default JavaScript code.

For global changes in your application, you can include the customized scripts in the UserWorkForm HTML fragment rule, which is called during the loading of a harness.

Create custom JavaScript code that you can use later to override the code in some of the Pega Platform rules.
  1. In the header of Dev Studio, in the Search field, search for and open the UserWorkForm HTML fragment rule.

  2. Click Save As.

  3. On the New tab, in the Context section, specify the context of the fragment rule:

    1. In the Development branch list, select the branch.

    2. Select the check box with your application name.

    3. In the Add to ruleset list, select the ruleset that is specific to your application.

    Do not change the name of the fragment rule.
  4. Click Create and open.

    The HTML fragment rule is now available to the application ruleset.
  5. On the HTML tab, in the text field, enter your custom JavaScript code.

    To change the default busy indicator image, perform the following actions:
    1. Create a binary file with your custom image.
    2. On the HTML tab of the UserWorkForm HTML fragment rule, in the text field, add the following snippet in HTML Source:
       pega.ui.busyIndicator.prototype.createIndicatorImage = function() {
       if(this.oSpan == null)
       var oSpan = this.oSpan;
       if (this._message && this._message.length > 0) oSpan.innerHTML = "<img src = 'webwb/CustomPreloader.gif'   alt='loading' />" + " " + this._message ;
       else oSpan.innerHTML = "<img src = 'webwb/CustomPreloader.gif' alt='loading' />";
  6. In the upper-right corner of the screen, click Save.

    All of the harnesses of your application now include the custom script, which runs whenever a harness is loaded.
Did you find this content helpful?

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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