Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to redirect parent page from UI action in iFrame

peter_repan
Tera Guru

Hi guys,

I have in CMS an iFrame with UI action (it's form of sysapproval_approver record).

After I submit this UI Action I want to redirect my parent page to different URL in server-side script.

Is there a way how to do it?

If I use action.setRedirectURL('<my_page>.do'); it just reload the iframe, not the parent page

-               If I use action.setRedirectURL('my_list.do'); it just reload the iframe, not the parent page

3 REPLIES 3

Community Alums
Not applicable

I think the syntax you want is:



[Edit: this should be correct now]


top.window.location = 'your.url-here.com';


Hi Andrew,



not really, because I need server-side solution, not client side.



Finally, I got workaround.



How to solve it:


- create a UI page with script "<script>parent.document.location.href="my_list.do"</script>"


- in UI Action call action.setRedirectURL("my_ui_page.do");



This workaround will do the trick


Community Alums
Not applicable

I'm glad that worked for you!



if you tick the "client" box in a ui action, you can use client-side script there, as well.