- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2019 09:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2019 09:22 PM
Hi,
UI scripts
Global UI scripts
You can create a UI script and designate it as global, which makes the script available on any form in the system. You cannot create a global UI script in a scoped application.
You can mark a UI script as Global to make it available on any form in the system. For example, you can create a UI script that has a function helloWorld(), and has the Global field checked:
function helloWorld() { alert('Hi'); }
After you create this global UI script, you can call the helloWorld() function from any client script or UI policy you write.
Create a UI script
Create a UI script to define reusable client-side JavaScript code.
Field | Description |
---|---|
Script Name | Name of the UI script. Ensure the name is unique on your system. |
API Name | The API name of the UI script, including the scope and script name (for example, x_custom_app.HelloWorld). |
Application | Application that contains the UI script. |
Active | Indicator of whether the UI script is active. Only active UI scripts can run. |
Global |
Indicator of whether the script loads on every page in the system. Note: Use caution when creating global UI scripts because they can impact performance. You cannot create a global UI script in a scoped application.
|
Description | Summary of the purpose of the script. |
Script | Client-side script to run when called from other scripts. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2019 09:21 PM
Hi,
UI scripts provide a way to group client-side JavaScript into a reusable content, similar to how script includes store server-side JavaScript. Administrators can create UI scripts and run them from client scripts and other client-side script objects and from HTML code as a reusable component.
You can get more details in here: https://docs.servicenow.com/bundle/madrid-application-development/page/script/client-scripts/concept/c_UIScripts.html
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2019 09:22 PM
Hi,
UI scripts
Global UI scripts
You can create a UI script and designate it as global, which makes the script available on any form in the system. You cannot create a global UI script in a scoped application.
You can mark a UI script as Global to make it available on any form in the system. For example, you can create a UI script that has a function helloWorld(), and has the Global field checked:
function helloWorld() { alert('Hi'); }
After you create this global UI script, you can call the helloWorld() function from any client script or UI policy you write.
Create a UI script
Create a UI script to define reusable client-side JavaScript code.
Field | Description |
---|---|
Script Name | Name of the UI script. Ensure the name is unique on your system. |
API Name | The API name of the UI script, including the scope and script name (for example, x_custom_app.HelloWorld). |
Application | Application that contains the UI script. |
Active | Indicator of whether the UI script is active. Only active UI scripts can run. |
Global |
Indicator of whether the script loads on every page in the system. Note: Use caution when creating global UI scripts because they can impact performance. You cannot create a global UI script in a scoped application.
|
Description | Summary of the purpose of the script. |
Script | Client-side script to run when called from other scripts. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2020 10:29 AM
how to stop alert function in global UI script. It is on load and not allowing me to log in to my instance.