The CreatorCon Call for Content is officially open! Get started here.

onChange script error: ReferenceError: gr is not defined function () { [native code] }

Gustavo8
Tera Contributor

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?

Gustavo8_0-1681771590439.pngGustavo8_1-1681771622400.png

 

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

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.

 

Thanks,
Anvesh

ritesh94
Tera Contributor

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

Teja11
Giga Guru

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.

Sagar Pagar
Tera Patron

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

The world works with ServiceNow