- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 12:28 AM
Hi all,
I would like to create a button on a form to run a certain report.
I have the button (ui action) but I'm struggling to get the script to run a certain report / open the report view (in a new tab).
Any help would be highly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 01:23 AM
Hello @Oliver Strein ,
Navigate to System UI -> UI Actions -> New -> Enter Name as "View Report" -> Select table ->
Checked the following checkbox :
Active
Show insert
Show update
Form button
List Context Menu
Set the condition : current.isValidRecord()
Add following script :
// redirect to view report
action.setReturnURL(current);
//action.setRedirectURL("sys_report_template.do?jvar_report_id=" + current.sys_id);
action.setRedirectURL("sys_report_template.do?jvar_report_id=d028d98f470111002ee987e8dee49097&jvar_selected_tab=myReports&jvar_list_order_by=&jvar_list_sort_direction=&sysparm_reportquery=&jvar_search_created_by=&jvar_search_table=incident&jvar_search_report_sys_id=&jvar_report_home_query=&sysparm_use_polaris=true" + current.sys_id); // in this you need to enter the report url
Please mark my solution correct or helpful, if applicable.
Thanks & Regards
Chaitali Vale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 01:23 AM
Hello @Oliver Strein ,
Navigate to System UI -> UI Actions -> New -> Enter Name as "View Report" -> Select table ->
Checked the following checkbox :
Active
Show insert
Show update
Form button
List Context Menu
Set the condition : current.isValidRecord()
Add following script :
// redirect to view report
action.setReturnURL(current);
//action.setRedirectURL("sys_report_template.do?jvar_report_id=" + current.sys_id);
action.setRedirectURL("sys_report_template.do?jvar_report_id=d028d98f470111002ee987e8dee49097&jvar_selected_tab=myReports&jvar_list_order_by=&jvar_list_sort_direction=&sysparm_reportquery=&jvar_search_created_by=&jvar_search_table=incident&jvar_search_report_sys_id=&jvar_report_home_query=&sysparm_use_polaris=true" + current.sys_id); // in this you need to enter the report url
Please mark my solution correct or helpful, if applicable.
Thanks & Regards
Chaitali Vale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 04:11 AM
thanks so much. My users are very happy. And I learned again.
Much appreciated.
Thanks and kind regards,
Oliver