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

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?

9 REPLIES 9

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

 

This might be came from an error in another UI Script, which can block the functionality of other scripts.

You can recheck if there is any recent changes in other UI Scripts.

Mohd Daud Khan
Tera Contributor

Hi @Daniel R1 @purshi 

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