onsubmit script error, not able to submit the client script

redth
Giga Expert

Hi, I'm receiving the below error when I try to submit the client script. Please assist. See this error on all the types of client script.

onSubmit script error: ReferenceError: validateFunctionDeclaration is not defined:

function onSubmit(){

var functionName = g_form.getValue("type");

if(functionName == "")

return true;

return validateFunctionDeclaration("script". functionName);

}

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

seems you are trying to call that function but it's not defined anywhere?

Are you having any UI script which holds this function -> validateFunctionDeclaration

Did you search that?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Kartik Sethi
Tera Guru
Tera Guru

Hi @akred 

 

Please clarify whether the undeclared function "validateFunctionDeclaration" is in an onLoad Client Script of any UI Script?

function onSubmit() {
	var functionName = g_form.getValue("type");
	if (functionName == "")
		return true;
	//"validateFunctionDeclaration" is not declared any where
	return validateFunctionDeclaration("script".functionName);
}

 

You are getting the error because of the undeclared function "validateFunctionDeclaration".

 


Please mark my answer as correct if this solves your issues!

If it helped you in any way then please mark helpful!

 

Thanks and regards,

Kartik

Mohd Daud Khan
Tera Contributor

Hi @Kartik Sethi 

I’m facing the same issue. Were you able to resolve it?