- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2021 05:59 AM
Hello everyone
I've been trying to get a UI script working without not much of a success.
SN's documentation in this regards do not cover all aspects of its potential usage. I've gone through all forum posts here, including: this and many others
Can anyone suggest what am I doing wrong ?
UI Script
<scope> = <scope> || {};
<scope>.<name>= (function initializeLibrary(g_form) {
var _localVariable = '';
function _localFunction() {
//do something
}
function _localFunction2() {
//do something
}
var functionToCall= function doProcessChanges(fieldName) {
//call local functions
//call AJAX
};
return {
processPhasingChanges: functionToCall
};
})(g_form);
onLoad Client Script order - 100
ScriptLoader.getScripts('<scope>.<name>.jsdbx');
onChange Client Script: order - 200
tried all variations, such as
- <scope>.<name>.processPhasingChanges
- processPhasingChanges
- <name>.processPhasingChanges
None seems to work. Any help is much appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2021 06:13 AM
Hi,
check out these links which have solution
How to call UI Scripts from Client Scripts
[SOLVED] How to call scoped UI script from catalog client script ?
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
‎03-17-2021 07:17 AM
That's true.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2021 09:27 AM
Just managed to get it done with the ScriptLoader....
so all in all, if you are using scoped client script with scoped ui script, go with ScriptLoader...
Thank you for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2021 08:59 PM
That's correct.
Please share the UI Script you created and how you are calling it from client script so that it benefits future readers as well
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader