- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:25 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 02:45 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:32 AM
Hi Kavya,
Can you help me understand the use case of this? It sounds like a very interesting scenario.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:33 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:37 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2016 10:42 AM
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?