onChange script error: ReferenceError: gr is not defined function () { [native code] }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 03:47 PM
Hi Everybody
I created a script activity in a Workflow, in some parts of the process I proceeded to create an Incident, but when I proceed to see the incident record, in the form I saw an error message with this description "onChange script error: ReferenceError: gr is not defined function () { [native code] }".
Has anyone had this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 09:21 PM
Hi @Gustavo8 ,
It is because of a onChange client script on active field. Please check the onChange client scripts on field active to identify this issue.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 10:30 PM
Hi Gustavo,
The screenshot of the script shared by you has a variable named 'grInc' whereas the error is related to the variable 'gr'. So, the error you are getting is not related the script you shared. Try to find out if there is any other onChange script running on the same field or another way to debug is to check if there is any onChange script which is creating a error message on this specific field.
Regards,
Ritesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 10:30 PM
Hi @Gustavo8 ,
The error is not related to script in the workflow.
You have an ONCHANGE client script on the field ACTIVE, in that you have used gr variable without defining. please check that.
Regards,
Teja
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 10:51 PM
Hi @Gustavo8,
The issue seems to be related to OnChange client scripts only. where gr object is not defied.
Note - Make sure you avoid using the GlideRecord in Client scripts. Use Client callable Script Include and GlideAjax call instead.
Thanks,
Sagar Pagar