Redirect page from UI action

Jolanta Jaskele
Kilo Contributor

Hello,

I try to redirect from backend to portal in the same page by using:

window.location.href = 'url';

and I get redirected like this:

find_real_file.png

 

Is there a way to redirect it without backend navigator and etc? It has to be the same tab

 

1 ACCEPTED SOLUTION

Hmm, I think I misunderstood, so you just want the whole page to reload to the portal without the nav bar?

 

Try this:

window.top.location.href = url

 

The key difference here is that we are now reloading the TOP frame as opposed to just the gsft frame.

View solution in original post

11 REPLIES 11

@Jolanta Jaskelevičiūtė so the issue is in your widget this is redirecting you in the same page in cluding left navigator which should not happen right ?

 

Jolanta Jaskele
Kilo Contributor

I am trying to redirect from backend UI action to Portal page

Yes, the issue is it is including navigator and also upper line of the backend

Hi there,

To load just the main frame without the nav_to refreshing:

var frame = top.document.getElementById('gsft_main'); // we will only reload the main frame
frame.src =  'YOUR_INSTANCE_NAME.service-now.com/srcm?id=form_tabbed_contract&table=ast_contract&sys_id=' + g_form.getUniqueValue();  

// redirect frame without the need to refresh nav_to. Give this the full URL of the page you want to redirect to (not including the nav_to)



 

Try that, hopefully it helps 🙂

Thanks for your help :), but unfortunately, I get the same result

Hmm, I think I misunderstood, so you just want the whole page to reload to the portal without the nav bar?

 

Try this:

window.top.location.href = url

 

The key difference here is that we are now reloading the TOP frame as opposed to just the gsft frame.