We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

On request item record client script error

rameshkurno
Tera Contributor

Please help with this error..it occurs on sc_req_item record in servicenow when saving.


Error MessageonSubmit script error: TypeError: ge.getElementParentNode is not a function:

function onSubmit() {

if (g_scratchpad.isFormValid) {

return true;

}

var vari = g_form.isVisible('is_this_request_for_you_VS');

//alert(vari);

if (vari === true) {

//alert("insideif");

var requestor = g_form.getValue('is_this_request_for_you_VS') == "Yes" ? g_user.userID : g_form.getValue('requested_for1_VS'); //requestor as logged-in user if "Is this request for you" is Yes else

"Requested For"

var ga = new GlideAjax('UserManagerUtil');

ga.addParam('sysparm_name', "getManagerInfo");

ga.addParam('sysparm_user', requestor);

ga.getXMLAnswer (function() { //checks if requestor's manager is present or not

var answer = ga.getAnswer();

if (answer== "no") { // getting no as value if user's manager is empty g_scratchpad.isFormVreturn true;

} else if (answer == "yes") { // getting yes as value if user's manager is empty

var link = 'set your manager information'; //creating link for the message that should redirect the user to the correct form or request page where they can set their manager information. g_form.addErrorMessage("You must have a manager set in ServiceNow to submit requests. Please " + link

+ ".");

}

});

return false;

} else { return true;

}

0 REPLIES 0