How to make all reference link to open in a new window by default?

vidhya_mouli
Giga Sage

I have a custom table u_mytable. It has a HTML field and when a user links a text in this field, can it be set to open automatically in a blank window. I am aware we can use the following:

vidhya_mouli_0-1709191338165.png

 

but I want to make it default if the user forgets to do this. 

 

Also, I have previous articles where the it was not specified how to open the links. Is there a way to change this to open in new window (instead of going into each article and manually changing it.)

5 REPLIES 5

Community Alums
Not applicable

Hi @vidhya_mouli,

I searched for your problem I got one similar question in community you can take reference - " https://www.servicenow.com/community/developer-forum/helsinki-service-portal-icon-link-new-tab/m-p/1... ".

 

Thanks and Regards 

Sarthak

Abhishek_Thakur
Mega Sage

Hi @vidhya_mouli ,

 

You can set the attribute of that field. 

action.setRedirectURL(rec);

 For more reference, you can go through this link: https://docs.servicenow.com/bundle/vancouver-api-reference/page/app-store/dev_portal/API_reference/A... 

If my understanding is correct, this one will specify which page it will be redirected to. However, I am looking to open the link in a new tab. Not sure how to use this.

Hi @vidhya_mouli ,

 

Then, please provide the attribute as target: _blank. I am sure it will work.

Please mark the helpful and accept the solution if it is really works from you.