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.

Need help on UI Action to redirect to portal

shaik_irfan
Tera Guru

Hi,

 

I have a button created on incident form when i click on it i want to redirect to Service portal categories place.

 

https://dev82927.service-now.com/sp?id=sc_category

 

can anyone please help me on this

1 ACCEPTED SOLUTION

Glad that it worked.

to open in new tab use this

var url = '/sp?id=sc_category';

g_navigation.open(url, '_blank');

Let me know if I have answered your question.

If so, please mark my response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Irfan,

 

In your UI Action code try adding below.

action.setRedirectURL("/sp?id=sc_category");

Hi  Jaspal,

 

Thank you but it did not worked on the list when i click on it is poping a message as not records selected

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can have UI action as client side

Onclick: redirect();

Script:

function redirect(){

var url = '/sp?id=sc_category';

top.location.href = url;

}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

Thank you it worked, can you please help me how to have it display only on related list and can i open it in new tab now it is opening on same window