Is there a way to know if form has been updated from client side? instead using current.operation() == 'update' ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 12:30 PM
Hello,
At the client scripts side is there a way to know if form has been updated ? instead using current.operation() == 'update' ? for example like UI policies when state changes set the worknotes as mandatory however this only works for a simple field, would like to know if there is a way for all form fields .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 12:35 PM
Hi Guille,
You could have a script like the following in an onSubmit client script
function onSubmit() {
var field1 = g_form.getControl('caller_id');
//See if the 'changed' attribute is true
if(field1.changed){
return confirm("The Caller field has changed.\nDo you really want to save this record?");
}
}
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 12:41 PM
Thanks, but maybe I did not explain well, I'm looking something not for an specific field, we need the entire form, we could do this by using a BR and use the following clause:
current.operation() == 'update'
That will let Servicenow know that my form have been changed regardless the previously updated field, I'm not sure if it possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 12:51 PM
Ok. You can use...
if (g_form.modified){
alert ("Something has changed");
}
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 12:36 PM