How can I refresh all the table when I change the state without enter to the record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 08:12 AM
I would like to know how I can refresh all the table when I change the state. In the same table, without enter to the record.
I made a Business Rule to update all the states from this record state.
So when I change the state I have to refresh list to see it. I would like to ServiceNow do it automatically.
I suppose this is a work for an Client Script, type onCellEdit, Field name: state.
I tried but doesn't work:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//Type appropriate comment here, and begin script below
GlideList2.get('current').refresh();
callback(saveAndClose);
}
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 09:47 AM
Hi Alejandro,
Please try this.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
callback(saveAndClose);
document.location.reload(true);
}
Cheers
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 11:43 PM
Hi Srini,
Doesn ´t work. Thanks for help.
I would like a function to refresh/reload all the table. I know is possible but I dont know how.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 11:50 PM
Hi Alejandro,
I can confirm that above code worked for me just fine.
Next steps: I would look at console for errors.
Are you writing this client script in a scoped app?
Cheers
Srini