UI page redirect to previous list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 10:09 AM - edited 06-26-2023 12:10 PM
I have a requirement to create a UI action that will mass update multiple records from a list view (My Groups Work). I have the UI page, and the UI list action created, but cannot figure out how to redirect back to the 'My Groups Work' lists view where the conditions are preset. I can link to the task list, but I really need to get to the full filtered list. My current redirect script is below:
var urlOnStack = GlideSession.get().getStack().bottom();
response.sendRedirect('task_list.do');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 11:14 AM
To redirect to previous page try:
window.location=history.back()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 11:36 AM
Hello @Mike_R
Thank you so much for your reply. I apologize (in advance) for the question ... I'm still pretty new to developing and writing code. Should the script look as follows:
var urlOnStack = GlideSession.get().getStack().bottom();
response.sendRedirect('window.location=history.back');
or should I leave out the last line in the above script and on the UI action add a line that looks like this:
action.setRedirectURL(window.location=history.back);
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 11:53 AM
I just re-read your initial post and I think I got a little confused. You mentioned a UI page and UI action. Is that accurate or did you just mean the list view of records and a list UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 12:10 PM
Yes. I have a UI action that pulls a UI page (GlideDialogWindow) that will populate fields the forms that are selected in the list view. When the ui page is saved then it should redirect to the same list view (My Groups View) but instead it goes to the full list of task records and not the filtered list. It's this part that I need help with.