- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 03:29 AM
Hello, i have a ui action button with this script. how do i make it so that the url gets opened in a new tab?
createRITM();
function createRITM() {
var tableName = 'alm_hardware';
var viewName = 'registrering_av_hardware_ved_innkjøp'; // give your view name
var po_number = current.u_uh_nr|| '';
var sys_id = current.sys_id || '';
var req_for = current.request.requested_for|| '';
action.setRedirectURL('https://testingnow.com/alm_hardware.do?sysparm_view=registrering_av_hardware_ved_innkj%C3%B8p&syspar...);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 09:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 03:49 AM
Hi @asd22
get the url which you want in comments.
var url = 'https:/servicenow.com/';
window.open(url,'_blank');
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 04:00 AM
do you mean like so?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 09:50 AM
Hi @asd22 ,
In your code, client checkbox is unchecked i.e. this UI action will be run at server side. It is not possible to open a new tab or window in a browser by server-side code alone.
You need to do it with both Client and Server Scripts.
Please refer the below thread to achieve the functionality :
You can take reference of the code mentioned in the above thread, try to configure server side logic in Client callable ScriptInclude and call script include in Clientscript using GlideAjax method.
OR
You can make/try the UI action client callable(Client checkbox should be true) and use top.window.open(url); to open the URL in new tab. Please see the below screenshot of test script.
Please mark reply as Helpful/Correct/Accept Solution, if applicable. Thanks!
Thanks & Regards
Jyoti Jadhav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2025 06:02 AM
I tried a ui action with client set to true and this script: