- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2020 01:19 AM
Hi Team ,
Need help. I am not sure I have built a catalog item and it works fine in CSM portal but not in service portal For example the below code is not working when running from Service Portal view. The alert is not triggered but it is triggered in CSM. Can you let me know why?? This is really weird.
var k =g_form.getValue('type_of_operation');
alert(k);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2020 01:21 AM
Hi,
please set the UI type = ALL for your 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
09-09-2020 01:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2020 01:25 AM
As Ankur already suggested check if UI type is set to ALL.
If yes, then go to browser console and check if there is any error coming there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2020 02:10 AM
Thank you guys, this is really helpful. I am very new to Service Portal. Can you let me know what is the alternative of getXMLWait in Service Portal. This can not be achieved through getXML call I guess.
I am running into an issue in processing this script that involves onSubmit validation, it was working fine in CSM portal. Any help will be highly appreciated.
if (c =='op_create' && e!='')
{
var agrp1 = new GlideAjax('AppDetails');
agrp1.addParam('sysparm_name','checkCiExist');
agrp1.addParam('sysparm_userID_1',e);
agrp1.getXMLWait();
var populate1 = agrp1.getAnswer();
alert(populate1);
if(populate1 =="failed1"){
}
else{
alert("The request is not fit for CI creation as the selected CI does exist");
g_form.clearValue('type_of_operation');
g_form.clearValue('application_name_1');
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2020 02:19 AM
Hi,
you will have to use getXML()
updated script below
if (c =='op_create' && e!='')
{
var agrp1 = new GlideAjax('AppDetails');
agrp1.addParam('sysparm_name','checkCiExist');
agrp1.addParam('sysparm_userID_1',e);
agrp1.getXML(callBackMethod);
function callBackMethod(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
var populate1 = answer;
alert(populate1);
if(populate1 =="failed1"){
}
else{
alert("The request is not fit for CI creation as the selected CI does exist");
g_form.clearValue('type_of_operation');
g_form.clearValue('application_name_1');
return false;
}
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader