- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 06:17 PM - edited 11-29-2022 09:05 PM
I need to run field auto-fill and validation for all catalog items.
So I made a common UI Script.
I try to call UI Script in Client Script but It shows this error message "(g_env) [SCRIPT:EXEC] Error while running Client Script "[Catalog Client Script Name]": ReferenceError: [UIScriptName] is not defined" in Service Portal.
Is there no way to call UI Script from Catalog Client Scripts for Service Portal?
UI Script :UIScriptName
var UIScriptName = Class.create();
UIScriptName.prototype = {
......
validate: function(value) {
var result= true;
.....
return result;
},
.....
};
Catalog Client Script onChange
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
return new UIScriptName().validate(newValue);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2024 10:42 AM
Hi Joy,
In case you haven't yet found an answer, this post may help:
Apparently, this solution is specific to calls from Service Portal, and apparently won't work if the call is made from the Native UI, such as through the Record Producer "Try It". Still looking for a solution for the latter. 😕
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 06:49 PM
Hi @Joy715 , Please make sure UI type of UI script is all, not desktop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 08:26 PM
Hi! Thank you for your answer.
but it already set All type of UI Type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2024 10:42 AM
Hi Joy,
In case you haven't yet found an answer, this post may help:
Apparently, this solution is specific to calls from Service Portal, and apparently won't work if the call is made from the Native UI, such as through the Record Producer "Try It". Still looking for a solution for the latter. 😕
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 01:16 AM
Thank you for answering my forgotten question!
It seems like I resolved it in a similar way to the solution you provided.