GlideUIScripts - Client
-
- UpdatedAug 1, 2024
- 1 minute read
- Xanadu
- API reference
The GlideUIScripts API provides methods to access UI scripts from within client-side code.
There is no constructor for this class. Access methods using the g_ui_scripts
global object in any client-side code, such as client or validation scripts.
This API is only supported in Workspaces and Service Portal. It is not supported in the Core UI (UI16).
To use this API, the UI Type field must be set to Mobile / Service Portal or All on both the client script and the UI script. It cannot be set to Desktop.
GlideUIScripts - getUIScript(String scriptName)
Calls a UI script from a client script or other client-side code. Returns a promise.
Use the then()
function to perform an asynchronous action after the call
resolves.
g_ui_scripts['nameOfScript'];
syntax.Name | Type | Description |
---|---|---|
scriptName | String | API name of the UI script to run. |
Type | Description |
---|---|
Promise | The result of the asynchronous call. |
Example
In this example, a client script calls a UI script to show an alert when the page loads.