I am getting alert msg even though it is not configure inside the script include
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 04:03 AM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var sysparm_reqfor = "subject_person";
var URL = "";
var reqFor = g_form.getValue('subject_person');
var someElse = g_form.getValue('open_on_behalf_of');
var ga = new GlideAjax('role_filter_Offboarding');
ga.addParam('sysparm_name', 'getGroupMembership');
ga.addParam('sysparm_user_name', reqFor);
ga.getXML(URLParse);
if (someElse == 'other') {
if (newValue == "Termination") {
URL = "/ourdowner?id=sc_cat_item&sys_id=3b24b5081be6745093602f49274bcb2d&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
} else if (newValue == "Redundancy") {
// URL = "/ourdowner?id=sc_cat_item&sys_id=f136cd141b42b01093602f49274bcb05&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
}
else if (newValue == "Termination_Bulk") {
// URL = "/ourdowner?id=sc_cat_item&sys_id=d3a84bd81b26b09093602f49274bcbf2&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
}else if (newValue=="Bulk_Request"){
URL = "/ourdowner?id=sc_cat_item&sys_id=b35781381b2dc6187fb852c91d4bcb60&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
}
// if (URL != "") {
// top.window.onbeforeunload = null;
// top.window.onunload = null;
// top.window.location = URL;
// g_form.clearValue("select_request_type");
}
else{
if (newValue == "Termination") {
URL = "/ourdowner?id=sc_cat_item&sys_id=3b24b5081be6745093602f49274bcb2d";
} else if (newValue == "Redundancy") {
// URL = "/ourdowner?id=sc_cat_item&sys_id=f136cd141b42b01093602f49274bcb05";
}
else if (newValue == "Termination_Bulk") {
// URL = "/ourdowner?id=sc_cat_item&sys_id=d3a84bd81b26b09093602f49274bcbf2";
}
else if (newValue=="Bulk_Request"){
URL = "/ourdowner?id=sc_cat_item&sys_id=b35781381b2dc6187fb852c91d4bcb60";
}
if (URL != "") {
top.window.onbeforeunload = null;
top.window.onunload = null;
top.window.location = URL;
g_form.clearValue("select_request_type");
}
}
}
function URLParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
// alert(answer);
if (answer == 'true') {
if (newValue == "Redundancy") {
URL = "/ourdowner?id=sc_cat_item&sys_id=f136cd141b42b01093602f49274bcb05&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
}
else if (newValue == "Termination_Bulk" && someElse == "other") {
URL = URL = "/ourdowner?id=sc_cat_item&sys_id=d3a84bd81b26b09093602f49274bcbf2&sysparm_reqfor=" + reqFor + "&sysparm_someelse=" + someElse;
}
else if (newValue == "Termination_Bulk") {
URL = URL = "/ourdowner?id=sc_cat_item&sys_id=d3a84bd81b26b09093602f49274bcbf2";
}
// alert(URL);
top.window.onbeforeunload = null;
top.window.onunload = null;
top.window.location = URL;
g_form.clearValue("select_request_type");
} else {
alert('Cannot Access this form as you need permission');
g_form.clearValue("select_request_type");
}
}
When select the type as bulk request it is showing the alert msg it should not show
0 REPLIES 0