How to auto refresh list view of a specific table ?? help required !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 07:21 AM - edited ‎07-19-2024 07:39 AM
Hi, There is a requirement to auto refresh the list view on an interval of 10 secs and also to add UI Action in the list view , when clicked it should refresh.
I created an UI Action, but the script is not working. can someone please check the script as well the conditions if there is any modifications required ??
Below is the logic that i have added :
***************************************************
function autoRefreshListView() {
// Get the current list view
var listView = GlideList2.get(GlideList2.LIST_VIEWS.INCIDENT);
// Refresh the list view every 10 seconds
setTimeout(function() {
listView.refresh();
autoRefreshListView();
}, 5000); // 10000 milliseconds = 10 seconds
}
autoRefreshListView();
****************************************************
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 07:29 AM
Hi,
I have multiple UI Actions in my PDI, named "Refresh". Have a look at those to see what is done. And please post script logic separately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 07:42 AM
Hi @Bert_c1 , thanks for responding !! I have added the logic above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2024 10:04 AM
Why not use the browser's, or Servicenow's context menu, to refresh the list?
However neither are automatic. And clicking a button is not automatic. Anyway, others here may have suggestions on what you want to do.