Getting error in g_scratchpad
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 11:03 PM
Hi team,
function onSubmit() {
if (g_scratchpad.validForm) {
return;
}
var reason1 = g_form.getValue('reason1');
var reason2 = g_form.getValue('reason2');
var mrvs = g_form.getValue('risk_rating_from_country');
var vk = new GlideAjax("Decision_table_risk_rating");
vk.addParam('sysparm_name', 'getriskratings');
vk.addParam('sysparm_from', g_form.getValue('from'));
vk.addParam('sysparam_to', g_form.getValue('to'));
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 && reason1 == '' && reason2 == '') {
g_form.setVisible('reason1', true);
g_form.setVisible('reason2', true);
g_form.setMandatory('reason1', true);
g_form.setMandatory('reason2', true);
g_scratchpad.validForm = false;
} else {
g_scratchpad.validForm = true;
g_form.submit();
}
});
return false;
}
Above mentioned code i am used to call the script include to on submit client script
front of the serviceportal it's working fine i am getting value and it's to variable but
If i used the in catalog item we have a TRYIT UI action if use this button and test it after i am getting the bellow error
onSubmit script error: ReferenceError: g_scratchpad is not defined:
function () { [native code] }
function () { [native code] }
below diagram is front end of portal
Team Help me to resolve this issue
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 01:31 AM
Please use below link :
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK