Service portal redirect issue

manju12
Tera Expert
  • Hi Team,

 

I have 3 widgets.

1. Data table OOTB widget.

2. Form widget (OOTB).

3. Cloned form widget.

 

If I click the record in data table widget then it will redirect to cloned form widget, it is working fine but if I click back browser button it will redirect to form widget (OOTB) but I want to redirect to data table widget.. please help me out from this..

 

Data table widget -> Cloned form. This is working fine.

I want to redirect like this 

Cloned form widget -> data table widget. 

 

Thanks,

Manju

3 REPLIES 3

Naveen20
ServiceNow Employee
Your history stack is [Data Table] → [OOTB form] → [Cloned form], so Back lands on the OOTB form.
Fix: In the Data Table widget's HTML, change the row link from id=form to your cloned form's page ID so the OOTB form is skipped entirely:
html <a ng-href="?id=my_cloned_form&table={{::data.table}}&sys_id={{::row.sys_id}}">
Now history becomes [Data Table] → [Cloned form] and Back works as expected.

Hi @Naveen20 ,

From Data Table -> Cloned form is working.
I need back landing page like
I want cloned form -> data table..


But currently it is working like this cloned for -> OOTB form -> data table..  This one I won't.. 
I want like cloned form -> data table.

 

Thanks,

Manju

quintinmorrow
Tera Contributor

Classic browser history headache with Service Portal — the back button just follows the URL stack and doesn't know about your intended widget flow. The cleanest fix is handling the redirect yourself inside the cloned form widget using spUtil.addErrorMessage or a client script that pushes state with $location on load, so the back button lands where you actually want it. Worth checking if your portal page URL changes between the two form widgets at all.