Watching a hidden field

rajalakshmi12
Mega Expert

Hi all,

Can anyone help me with the topic about watching a hidden field. The below link has the steps to watch a hidden field.

https://docs.servicenow.com/bundle/london-application-development/page/script/debugging/task/t_UsingFieldWatcher.html#t_WatchingAHiddenField

May I know what a hidden field is, is it any field which is not made visible in the form or any other specific meaning to it. Also, I tried enabling the watch fielder fora hidden field but I am unable to achieve it when opening the form.

 

Thanks & Regards,

Raji

6 REPLIES 6

Alikutty A
Tera Sage

Hello,

Any fields hidden on form can be made to be watched using the script mentioned. You need to first execute this script on a background script. Then open the form, Make sure you have a client script, UI policy or ACL which is executed when the form is opened, or else it wont show you the logs in field watcher.

Also try to make that field visible (using the UI policy or client script conditions) and see if it appears on the log.

Thanks!

rajalakshmi12
Mega Expert

Thank you for the reply. But there is no option to give the table name but only field name in the syntax. How will the system know that the field which am enabling belongs to that specific table. Else, is it that the field watcher will watch all the table with this field name.

You should try table_name.field_name.

For eg

gs.getSession().setWatchField("incident.assigned_to");

Once you do this, right click on field and you can see the Unwatch option.

rajalakshmi12
Mega Expert

 

Thanks a lot, it works !

May I know how to disable as well.