How can I link to UI page from another UI page?

jenny32
Tera Guru

Hi All,

        Please help me out !!

                                      In an "UI page",I have a button. Onclick/onsubmit of that ui page I need to map to another "UI page".

                                              I tried using anchor tag but it is not working.

                                                <a href="ui_page.do?name=render_chart"><button>Run</button></a>

                                              Tried client script also but not getting how can I write the functionality to map to another UI page.

Thanks in advance.

Jenny.

1 ACCEPTED SOLUTION

yetesh_ch
ServiceNow Employee
ServiceNow Employee

Hi Jenny,


Do this:



In first UI Page, write this:



<g:ui_form>


      <p>Click OK to run the processing script.</p>


      <g:dialog_buttons_ok_cancel ok="return true" />


  </g:ui_form>



In Processing Script of first UI Page, write this:



response.sendRedirect("ui_page.do?sys_id=<sys_id_of_second_ui_page>");



Copy sys_id of second UI Page and put it in <sys_id_of_second_ui_page>


View solution in original post

13 REPLIES 13

ohhgr
Kilo Sage
Kilo Sage

Hi Jennifer,



Have you tried using gs.setRedirectURL(newpage URL) in the processing part of first UI page?



Thanks,
Mandar


Hi Mandar,


       


                  I tried using gs.setRedirectURL(newpage URL), but it didn't work.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jennifer,



Try this and let me know the outcome.


response.sendRedirect("test.do"); //Replace test with the UI page name


jenny32
Tera Guru

Hi Pradeep,



In UI page response.sendRedirect is not working.   Can you provide a snippet of the code where you tried?



Thanks,


Jenny.