Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Alert not firing on onChange client script

sigmachiuta
Kilo Guru

i have a onChange catalog client script that DOES change the field values so it is running but it doesn't throw the alert.

if(newValue == 'No'){

      alert(getMessage('test'));

      g_form.setValue('foo' , 'No')

      g_form.setValue('bar' , 'No')

   

      }

--or

if(newValue == 'No'){

      alert('test');

      g_form.setValue('foo' , 'No')

      g_form.setValue('bar' , 'No')

   

      }

1 ACCEPTED SOLUTION

clear cache and check to clear form data and that should resolve that part of it.


View solution in original post

39 REPLIES 39

Abhinay Erra
Giga Sage

Is it throwing alert in the second script?


no neither are working.


I do not think it is entering into that if


but its setting the field values just not popping the alert