- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 09:06 AM
Hi ServiceNow Community Developers
I am trying to refresh a list view on a homepage using a UI action that has the refresh method however it's not working, instead it throws the following error on the browser console:
Error running context menu 'Perform Technical Assessment Task': TypeError: Cannot read property 'refresh' of undefined
Here is the code I have in my UI action:
function performTechAssessment() {
nowRefresh(g_list.getTableName());
}
function nowRefresh(id) {
alert ("inside refresh method " + id);
GlideList2.get(id).refresh();
}
Would you please advise as to what it is that I am doing wrong here.
Thanks
Johannes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 12:57 PM
Hi Guys,
A colleague of mine helped me to figure this out
here is the correct code that worked and refreshed my list view as expected:
function nowRefreshTheList() {
var w = top.gsft_main || top; //support for both having frame(navigator) and no frames
w.location.reload();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 09:09 AM
You can try doing redirect instead of refresh method
http://wiki.servicenow.com/index.php?title=UI_Actions#Using_a_UI_Action_to_Redirect_to_a_URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 12:57 PM
Hi Guys,
A colleague of mine helped me to figure this out
here is the correct code that worked and refreshed my list view as expected:
function nowRefreshTheList() {
var w = top.gsft_main || top; //support for both having frame(navigator) and no frames
w.location.reload();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2020 01:22 PM
Can you help me with the below thread. It is similar to this one.
https://community.servicenow.com/community?id=community_question&sys_id=b43a7912dbc7c014d82ffb243996...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2021 11:12 PM
If someone is looking for a solution on how to retrieve the current table name on a list view without using DOM:
function refreshList() {
GlideList2.get(Object.keys(GlideLists2)[0]).refresh();
}