Skip to main content


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

Adding scripts and style sheets to a harness

Updated on November 15, 2021
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.

Note: 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.
Before you begin: 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:
    ChoicesActions
    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.
    Note: 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.

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.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us