Alert a Message and Notification on change of any field on the form

kavyahv
Kilo Contributor

Dear All,

I need to alert a message and a notification needs to be triggered on change of   any of the field on the form.

Please help.

Thanks & Regards,

Kavya

1 ACCEPTED SOLUTION

Abhinandan Pati
Giga Guru

Hi Kavya,



You can use 'g_form.modified method to check for changes on the form. And on the server side you can make use of   'GlideScriptRecordUtil' methods. Below mentioned wonderful SNOWGuru article should help you



http://www.servicenowguru.com/scripting/business-rules-scripting/checking-modified-fields-script/



Thanks,


Abhinandan


View solution in original post

18 REPLIES 18

Chuck Tomasi
Tera Patron

Hi Kavya,



Can you help me understand the use case of this? It sounds like a very interesting scenario.


Abhinay Erra
Giga Sage

Write an onchange client script on updated field and put an alert inside the onChange() function.


Note Updated field should be on the form layout.



Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response


Hi Abhinay,



The trick to that solution is that Updated doesn't get updated until after the form is submitted. It's not changed dynamically so the client script won't trigger.



This would have to be an onLoad script that figures out all the fields currently on the form then sets up individual onChange() events for each. Notifications will have to be triggered via GlideAjax. I just wouldn't want to be the user who receives an email every time a field is changed! Hence my question about the use case.


I agree. how can I miss that updated will not be changed until after the form gets submitted. We could write an after business rule and compare previous and current values of updated field and display an info message right?