- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 07:30 AM
The script include will return the stringify value shown below.
*** Script: JSON.stringify(obj): ["ABC","AF","EFD","CGED","AAAA","BBBB","CCCC","ZZZZZ",""]
I want value above to appear in a Select Box type of catalog variable. The catalog client script below returns null as an answer. What could have gone wrong?
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var gb = new GlideAjax('ORGANIZATIONAjazUtils');
gb.addParam('sysparm_name', 'getName');
gb.getXML(getResponse);
function getResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert("Answer: " + answer); //null is returned
var array = answer.split(',');
for (var i = 0; i < array.length; i++) {
g_form.addOption('client_company_name', array[i].toString(), array[i].toString());
}
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 08:45 AM - edited 05-17-2024 08:45 AM
Hey @tsoct
I've gone through this in my own PDI, and the only way I was able to replicate what you're seeing was if the user triggering the change didn't have the role for the script include. Have you checked the SI ACL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 08:45 AM - edited 05-17-2024 08:45 AM
Hey @tsoct
I've gone through this in my own PDI, and the only way I was able to replicate what you're seeing was if the user triggering the change didn't have the role for the script include. Have you checked the SI ACL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2024 08:24 PM
This is indeed the reason!