Come back to previous browser tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 01:31 AM
Hi everyone,
I have configured a UI Action which open a new tab on browser with a record producer. I need to come back to the previous opened tab on browser (where I clicked UI Action) when I submit record producer.
I have tried window.history.back() and window.history.go(-1) but it doesn't work.
How can I achieve that?
Thanks in advance.
Dennis.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 01:44 AM
Hey,
Didn't really try this but found something across the community:
GlideSession.get().getStack().bottom();
Is it possible to get Previous URL in ServiceNow?
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 03:56 AM
Hi Aman,
Thanks for your response. It retrieves previous URL but my need is to close the current tab and go to the previous one.
Best regards!
Dennis.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 05:51 AM
That is not possible, to close a tab and then redirection, have you seen this in any real-life scenario o any app, where on button click it would close the current tab and redirect to previous page?
I think that is not possible
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar