Opening URL on same window / Tab in Mobile Interface?

vineetk
Giga Contributor

Hello Everyone,

I am trying to redirect a URL by using action.serRedirectURL(url);

But when I use this function in UI action it redirects me to the specified URL but into a new window / Tab and not in the same window.

I want, it to open in same window / tab.

Please let me know your suggestions on same.

Thank You

Vineet

1 ACCEPTED SOLUTION

vineetk
Giga Contributor

Hello Everyone,



Got the reason why I was getting redirected to new tab / window.


Earlier I was using the below url for redirecting:



var url = "https://<instance-name>/$m.do#/form/sc_req_item/"+current.sys_id+"/sysparm_view=Mobile";


action.setRedirectURL(url);



But instead, have to use the URL in the following form and which helped me to redirect on the same tab / window.



var url = "#/form/sc_req_item/"+current.sys_id+"/sysparm_view=Mobile";


action.setRedirectURL(url);




i.e. just the url from "#/form" excluding the <instance-name> part.




Thank you


View solution in original post

9 REPLIES 9

Hi Berny,



But, if I am not wrong is it possible to have UI Action of client type in case of Mobile UI Actions?


Also, "new_record" how this works, do I have to write a code which redirects via GlideRecord..?



Thanks


Vineet


Hi Berny,



Actually I am using the below code for redirecting:


action.sendRedirectURL("https://<instance-name>/$m.do#/form/sc_req_item/"_current.sysapproval.sys_id);



i.e. trying to redirect to the current record from list of records under "My Approvals".



Please let me know your observations on same.



Thank You


Regards


Vineet


vineetk
Giga Contributor

Hi All,



I have tried the client version of UI Action as well.


I have actually created a UI Action on "sc_req_item" form and have written the following code:


client check box: true


Onclick: RevertbackApp()



script:


function RevertbackApp()


{


    window.open("https://<instance-name>/$m.do#/form/sc_req_item/"+current.sys_id+"/sysparm_view=Mobile","_self");


}



And I have made this UI Action to be visible on Mobile View on "sc_req_item" form as well.


But the problem is I am not getting the UI Action on Mobile interface.



Please provide your suggestions on same.



Thank You


Regards


Vineet Kumar


vineetk
Giga Contributor

Hello Everyone,



Got the reason why I was getting redirected to new tab / window.


Earlier I was using the below url for redirecting:



var url = "https://<instance-name>/$m.do#/form/sc_req_item/"+current.sys_id+"/sysparm_view=Mobile";


action.setRedirectURL(url);



But instead, have to use the URL in the following form and which helped me to redirect on the same tab / window.



var url = "#/form/sc_req_item/"+current.sys_id+"/sysparm_view=Mobile";


action.setRedirectURL(url);




i.e. just the url from "#/form" excluding the <instance-name> part.




Thank you


Great to hear your were able to get it solved. Thanks for sharing the solutions Vineet!



Thanks,


Berny