What parameters can be passed to a URL to open in new tab?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 09:32 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 09:45 PM
url is part of system property as mentioned in my post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 10:53 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 10:06 PM
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");