OnSubmit client script is not working on Order guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:47 AM
Hi All,
I having Order guide with 3 catalog item.I have written onsubmit client script for one of the item.
I need to avoid form submission based on one condition.Condition also matching and alert message also throwing but form gets submiitted.
Its working fine in seprate catalog item but issue when submits from order guide.
Should I need to write script n Order guide as well?
If yes means how should get variables of particular item inside order guides script?
This script written on the item not on order guide:
function onSubmit() {
var fname=g_form.getValue('first_name');
var surname=g_form.getValue('surname');
var manager=g_form.getValue('user_line_managers');
var ga = new GlideAjax('WOWUtilsAJAX');
ga.addParam("sysparm_name","CheckDuplicateUser");
ga.addParam('sysparm_fname',fname);
ga.addParam('sysparm_surname',surname);
ga.addParam('sysparm_manager',manager);
ga.getXML(Check);
function Check(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer=='true'){
alert('A duplicate user has been found in SWOW. Are you sure you want to continue with this request?');
return false;
}
}
}
Thanks
Venkatesh Dhanapal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 03:56 AM
Hi Venkatesh,
Try using XMLWait here.
post me your feedback
Please Hit ✅Correct, âÂ��Helpful, or ��Like depending on the impact of the response
Have a lovely day ahead
Regards,
Divya Mishra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 04:14 AM
Hi Divya,
XMLWait() is not working
Thanks
Venkatesh Dhanapal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2018 04:22 AM
Hello Venkateshdhanapal,
Are you recently moved to new version of Service Now. Please let me know. I also facing similar issue after moving Helsinki to Kingston.
The On Submit script does not get call, i raised the hi ticket for it. If you have any work-around for it please help.
Thanks,
Faiji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2018 04:55 AM
Hello Venkateshdhanapal,
Please set the below property true. It will work in order guide also.
glide.sc.guide.tab.validate
Thanks,
Faiji