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

bammar
Kilo Sage
Kilo Sage

take off the double quotes

.getValue('fieldName')

Daniel R1
Kilo Contributor

How am I supposed to do that when I don't even know where that script that is causing the error is located?

Tony Chatfield1
Kilo Patron

The client script generating the error appears to be a SNC platform script
/nav_to.do?uri=sys_script_client.do?sys_id=30d8ba710a0004df0c51c0c92601037b

I would set your 3 custom client scripts to inactive
test to confirm the issue is resolved
then activate them 1 at a time and test to validate each script.
Once you know which script is at fault it will be easier to diagnose the issue.

Yes! That's the script that's causing the problem, none of the scripts I mentioned are active, I tried disabling the script you  listed but I get the same error 

find_real_file.png

 

SSo what can I do to fix this? I cannot update or save any script 😕