The CreatorCon Call for Content is officially open! Get started here.

On Saving the record in service portal, it is staying in the current page.

Yesh
Tera Contributor

Hi Team,

By saving the form in portal is still staying in the current page. But I need it to redirect to the previous page on saving the form in portal. Anyone know how to achieve it?

Thanks & Regards,

Yesh

1 ACCEPTED SOLUTION

Sulabh Garg
Mega Sage

Hi Yesh,

Please check thi slink, you will find solution here

https://community.servicenow.com/community?id=community_question&sys_id=60f7cb2ddb1cdbc01dcaf3231f96...

 


Please Mark ✅ Correct/helpful, if applicable, Thanks!! 
Regards
Sulabh Garg

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

View solution in original post

4 REPLIES 4

Sulabh Garg
Mega Sage

Hi Yesh,

Please check thi slink, you will find solution here

https://community.servicenow.com/community?id=community_question&sys_id=60f7cb2ddb1cdbc01dcaf3231f96...

 


Please Mark ✅ Correct/helpful, if applicable, Thanks!! 
Regards
Sulabh Garg

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Yesh
Tera Contributor

Hi @Sulabh Garg ,

I have checked the link you have shared, it is for redirecting to specific page. But I want it to redirect to the previous page.

Thanks

Yesh

You can mention the previous page URL as a specific page. What is the issue you are facing..

Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Valmik Patil1
Kilo Sage

Hi Yesh,

You can try below two option in widget client script after your save code

Use location.href = "homepage url"

or

$window.history.back();

In my widget I have redirected to main portal , Please refer below code

if(c.data.userAvailable==false){
		sessionStorage.clear();
		window.location.href="wsmgmt"; // specify your page name or id
	}

Thanks,

Valmik