Which syntax should I used instead of 'current' in client script.When I use 'current' it is getting run time error and showing the message 'The object "current" should not be used in client scripts.'

rock2freedom
Mega Contributor

Which   syntax should I used instead of 'current' in client script.When I use 'current'   it is getting run time error and showing the message 'The object "current" should not be used in client scripts.'

4 REPLIES 4

Mihir Mohanta
Kilo Sage

Hi Soumen,



current is used in server side scripting.


You can use g_form instead of current in client script.



Thanks


Mihir


Thanks Mihir.It is working I am quite new with service now so i am facing this types of problem in regular basis


Ok.



Please go through below link.It might helpful to you to learn scripting in ServiceNow.


Script in ServiceNow - ServiceNow Wiki



Thanks,


Mihir


sergiu_panaite
ServiceNow Employee

What are you trying to achieve in the first place with client scripts that you need to use the "current" object?



For client scripts you can use g_form to set or get values.



Regards,