- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 03:20 AM
I want to run a report when i click a ui action called test:
I wrote this on the onclick field of ui action:
action.setRedirectURL('https://dev10361.service-now.com/sys_report_display.do?sysparm_report_id=22ef12f30f26620007753b8ce10...
This is the URL of the published report that i want to run on click of 'test' ui action.
This isn't working.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 03:57 AM
Hi,
Try this
function runReport(){
url = '<url of your report>'
var newWin = window.open(url);
newWin.document.getElementById('run-report').click();
}
to get the url of the report I opened the report i wanted and then opened the developer console. In the console type this.location.href and right click the link and copy the link address.
Here is the UI action. Works for me.
best,
Tone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 08:32 AM
Hi,
do location.href = url to prevent it from opening in a new tab.
function runReport(){
var url = '';
location.href = url;
}
Tone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2016 12:08 AM
That works.
Thanks for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 08:57 PM
window.open(url, "_self");
use the above line to open in same page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2016 12:09 AM
this didn't work.