Grtting error on g_scratchpad using in onsubmit client script(catalog item)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 02:10 AM
Hi team,
i am calling script include in on submit client script and i used the g_scratchpad method i am getting below error
onSubmit script error: ReferenceError: g_scratchpad is not defined:
function () { [native code] }
function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_scratchpad.validForm) {
return;
}
var partner = g_form.getValue('select_partner');
var segment = g_form.getValue('segment_lead');
var mrvs = g_form.getValue('itinerary');
var vk = new GlideAjax("Decision_table_risk_rating");
vk.addParam('sysparm_name', 'getriskratings');
vk.addParam('sysparm_from', g_form.getValue('from_originating_country'));
vk.addParam('sysparam_to', g_form.getValue('to_destination_country'));
vk.addParam('sysparam_mrvs', mrvs);
vk.getXML(function risk(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert('risk_rating' + answer);
g_form.setValue('risk_rating', answer);
if (answer == 1 && partner == '' && segment == '') {
g_form.setVisible('partner', true);
g_form.setVisible('segment', true);
g_form.setMandatory('partner', true);
g_form.setMandatory('segment', true);
g_scratchpad.validForm = false;
} else {
g_scratchpad.validForm = true;
g_form.submit();
}
});
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 12:14 AM
Thanks for your ans
Value is setting correct but its not allowing to submit any condition