The CreatorCon Call for Content is officially open! Get started here.

What parameters can be passed to a URL to open in new tab?

theBeastMaster
Mega Guru

On Kb articles, there is a button "Create Incident"

Once we click on it, it opens incident form on the same page.

url for the same comes from "glide.knowman.create_incident_link" property.

for eg: this is the url:

incident.do?sys_id=-1&sysparm_query=active=true^comments=(Created after Knowledge search: $[HTML:knowledgeRecord.short_description])&sysparm_stack=knowledge_home_launcher.do

Is there a way, this url can be modified so that it opens the incident form in a new tab or window?

or if anyone can advise where this property is being referred?

7 REPLIES 7

url is part of system property as mentioned in my post

Hi,

So the link is present in system property

you can have this approach; it is not recommended to have GlideRecord; as an alternative you can have script include function and call that using GlideAjax and then open in new tab

1) make the UI action as client side by setting the checkbox of client as true

2) onclick -> openLink()

script as below

function openLink(){

var url= '';

var gr = new GlideRecord('sys_properties');
gr.addQuery('name','glide.knowman.create_incident_link');
gr.query();
if(gr.next()){
url = gr.value;
}

top.window.open(url, '_blank');

}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Krishna  Penaka
Tera Expert

Hi,

If you have the url then you can do this using an achor tag by adding target="_blank" like so

<a href="www.example.com/example.html" target="_blank">link text</a>

Else you can have an onclick function that takes you to the client script in which you would format the url and use this

window.open("https://www.w3schools.com");