How can you refresh a list view from a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2014 11:24 AM
Hey guys....
Not sure if I am doing something wrong here. I thought this would be simple.
I have a before Business Rule that is updating a value when another field changes. When I update the field from the list view, I have to click the breadcrumb to refresh the screen and see the change to the other field. Is there a way to refresh the list view from a script?
I tried g_list.refresh(); from an onCellEdit but that just locked up when I tried to change the value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2015 01:51 AM
A possible workaround would be to use the split screen feature. When you update a record in the form pane, values of the cells in the list pane refresh automatically.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2015 05:34 AM
Hi,
Do like this example:
refreshAffectedServices();
function refreshAffectedServices(){
var listId = g_form.getTableName() + '.task_cmdb_ci_service.task'; //Replace with the ID of your list
if(typeof $(listId) != "undefined") {
GlideList2.get(listId).setFilterAndRefresh('');
}
}
The ID of the related list should be current_table_name.related_table_name.refrence_field_name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2017 11:45 AM
I had this same issue where I wanted to refresh a related list after updating a record (without reloading the page).
I did this by using the following line in my script (UI Action):
g_list.refresh(1);
I found this by viewing the source code for the UI Context Menu called "Refresh List".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2017 01:27 AM
Client Script - onCellEdit
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
callback(saveAndClose);
GlideList2.get("table_name").refresh();
}