Come back to previous browser tab

Dennis2
Kilo Expert

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.

3 REPLIES 3

Aman Kumar S
Kilo Patron

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 🙂

Best Regards
Aman Kumar

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.

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 🙂

Best Regards
Aman Kumar