Skip to main content
LinkedIn
Copied!

Table of Contents

Adding scripts and style sheets to a harness

Applicable to UI-Kit applications

Add custom functionalities and styling to a harness by supplementing out-of-the-box components with your own scripts. This approach allows you to override standard settings that apply to the harness form for greater design flexibility.

For example, you can create a script that adds a code-formatting plugin to the Rich text editor toolbar, to improve the user experience.

Adding scripts is also necessary if your application uses custom JS methods, components, and controls that call the run script action.

As a best practice, apply styles through the skin rule. By using a skin rule you ensure that the styles apply uniformly to all work item harnesses throughout your application.
Upload the file with your custom script to the application as a text file.
  1. Search for and open the harness that you want to edit.

  2. On the Scripts & styles tab, add the custom script:

    Choices Actions
    JavaScript
    1. In the Scripts section, click the Add a row icon.

    2. In the Type field of the new row, select js.

    3. In the Name field, select the text file with script.

    CSS
    1. In the Style sheets section, click the Add a row icon.

    2. In the File name field, select the text file with the script.

    3. Optional:

      To reduce the size of the CSS file for the harness, select the Generate harness-specific CSS check box.

  3. Optional:

    To add more scripts, repeat step 2.

    The scripts execute in the order in which you list them. You can reorder the scripts by dragging them into place.
  4. In the ruleform, click Save.

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