change Service Portal page URL

stryker129
Mega Guru

Hi guys.

I've the following navigations:

https://my-instance.com/portal/     --- for list of users

https://my-instance.com/portal/?id=user_profile&sys_id=d34f5523dsfg       ---- for   specific user

The issue is in the BACK browser button: if I navigate from list of users page to specific user page - and then click "Go back" browser button - it redirects to the same page instead of list of users page.

Is there a way to fix that? how?

Thanks

1 ACCEPTED SOLUTION

stryker129
Mega Guru

Using


location.href =


instead of


location.replace


fixes my issue


View solution in original post

3 REPLIES 3

Andrew Wortham
Kilo Guru

Hello Ivan,



I was unable to reproduce the issue you are experiencing.



The back button for the browser works specifically with the stack of pages you have visited.   And will navigate you back to the page you were previously on.


How does the Back button in a web browser work? - Stack Overflow



Navigating from


/sp?id=list&table=sys_user


to


/sp?id=form&table=sys_user&sys_id=00189b324f1e0200c0adfe618110c76d



and then back worked fine for me as well as from


/sp


to


/sp?id=user_profile&sys_id=6816f79cc0a8016401c5a33be04be441


and back.



Can you provide more details around what browser you are using and how to reproduce the issue?



Best,


Andrew


Hi Andrew,


Sure. Here is the screen cast: YouTube   (sorry for the resolution)


Steps to reproduce:


1. Go to instance: in my case https://dev18775.service-now.com/nav_to.do?uri=/home.do%3F


2. Type in nav bar path to Service Portal page: in my case - https://dev18775.service-now.com/gfl_portal


3. Then go to specific customer - in my case https://dev18775.service-now.com/gfl_portal/?id=gfl_cust_prof&sys_id=9fdca1e5db623200b7d0f20ebf96191...


4. Now I need to get back to https://dev18775.service-now.com/gfl_portal   page by clicking "Go back" browser button - it returns me to https://dev18775.service-now.com/nav_to.do?uri=/home.do%3F instead of https://dev18775.service-now.com/gfl_portal



Any thoughts ?


stryker129
Mega Guru

Using


location.href =


instead of


location.replace


fixes my issue