Error in client scripting course - onSubmit script error: ReferenceError: validateFunctionDeclaration is not defined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 01:33 PM
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:
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
and the onSubmit script only has this code
What is going on? Am I doing something wrong?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 02:13 PM
take off the double quotes
.getValue('fieldName')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 03:03 PM
How am I supposed to do that when I don't even know where that script that is causing the error is located?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 03:07 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 03:15 PM