Error in client scripting course - onSubmit script error: ReferenceError: validateFunctionDeclaration is not defined

Daniel R1
Kilo Contributor

Hi, I'm doing the paris scripting course https://developer.servicenow.com/dev.do#!/learn/courses/paris/app_store_learnv2_scripting_paris_scri... and I'm on the client scripting module learning about the onLoad, onSubmit and other different functions, but I cannot activate the example scripts that I got from the needit application, I get the following error when I update or save any script:

find_real_file.png

onSubmit script error: ReferenceError: validateFunctionDeclaration is not defined:
function onSubmit() {
    var functionName = g_form.getValue("type");
    if (functionName == "")
       return true;

    return validateFunctionDeclaration("script", functionName);
}

 

But I only have 3 scripts 

find_real_file.png

and the onSubmit script only has this code 

find_real_file.png

What is going on? Am I doing something wrong?

8 REPLIES 8

Hi, don't disable this SNC script, it is validating client scripts.

Disable your custom scripts and any OOB script you have modified, this should resolve the issue?
Then enable them one at a time to work out where the issue is.

I read this response too late and deleted the Service Now script, is there any way I can recover it :(? 

purshi
Tera Expert

hi @Daniel R1  what was the solution for the above issue menyioned as i am also having similar issue after upgrade

 

Mohd Daud Khan
Tera Contributor

Hi @Daniel R1 @purshi 

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