How to override the service now's email notification onclick event

803 Views Asked by At

I have a requirement that, when I click the email notification link in ServiceNow, the system should check whether a particular field is null.

If it is not null then only the ServiceNow's email notification window should open, otherwise one alert box should come say like please enter that field first.

1

There are 1 best solutions below

0
On

As long as you are ok w/ all this validation being done client side you could modify the onClick event on the email notification link and add an additional function to check the value of the field and if not null, then call the original email onClick function.

Prototype is available in ServiceNow Forms clients side and provides a method to update attributes on elements.

You would need to modify the onClick function on the element with id='email_client_open', add a new onClick function to check that the field in question is populated and if so call the original function 'emailClientOpen(this, 'incident')' with the appropriate parameters.