OnSubmit client script is not working on Order guide

venkateshdhanap
Tera Contributor

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

5 REPLIES 5

divya mishra
Tera Guru

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


Hi Divya,


XMLWait() is not working


Thanks


Venkatesh Dhanapal


Faizi
Tera Contributor

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

 

Faizi
Tera Contributor

Hello Venkateshdhanapal,

Please set the below property true. It will work in order guide also.

glide.sc.guide.tab.validate

 

Thanks,

Faiji