- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 06:43 AM
Hi,
I have to hide a Ui action on the change form on change of the configuration item. How do I refer to the UI action in the on change client script of the configuration item field.Please help me out
Thanks,
Shruthi.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 07:37 AM
Hi Shruthi,
Did you set this field to false?
Isolate Script - false
- This field is not on form but from list you can make it false
- by default it is true
- If that is true DOM won't work
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 06:51 AM
Hello
You don't have to call the UI action into Client Script. This can be done directly from the UI action.
In the Condition field of the button use this - current.<field name>.changes()
Please hit correct if this resolves your issue.
Thanks
Nitin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 08:30 AM
Hi
Place a function in an onload script (only works in global scope)
- Client Script function onLoad() { } // You can call this in UI Actions // Only works in global scope (does not work in scoped apps) // Will only work for UI Action of the same table function yourFunctionHere() { // Code here }
- UI Action yourFunctionHere();
Client Script
function onLoad() {
}
// You can call this in UI Actions
// Only works in global scope (does not work in scoped apps)
// Will only work for UI Action of the same table
function yourFunctionHere() {
// Code here
}
UI Action
yourFunctionHere();
2) Write a UI Script
UI Script yourFunctionHere
// This will be callable from all client scripts form any table
// If global is not ticked, you must use ScriptLoader API
function yourFunctionHere() {
// Code here
}
UI Action
//If global is not ticked on UI Script
getScripts("yourFunctionHere", runScripts)
function runScripts() {
yourFunctionHere();
}
//If global is ticked on UI Script
yourFunctionHere();
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2021 12:22 AM
Is it possible to make a call from catalog client script [OnSubmit] to Flow designer action ?