- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2011 12:10 PM
Correct, that's where the code is. You will have to transfer that code to a UI Action. There are some notes in there about available variables. I sent this so you could start by creating the UI Action with this code as a basis(needing some modification of course). For example, you will need to replace variable referencing the sys_id.
Give it a shot, post your code if it doesn't work and we can go from there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 08:04 PM
Hi,
I tried the same piece of code in my UI Action but it is redirecting to the previous visited page. Please let me know if where I should make changes to this code. Here is the code I have been using,
runContextAction();
function runContextAction() {
var sysparm_rows = g_list.grandTotalRows;
var num_rows = parseInt(sysparm_rows);
var sysparm_query = g_list.getQuery({all: true});
var sysparm_view = g_list.view;
if (num_rows < g_export_warn_threshold) {
var dialog = new GwtPollDialog(g_list.tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_pdf');
dialog.execute();
return;
}
var dialog = new GwtExportScheduleDialog(g_list.tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_pdf');
dialog.execute();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2018 11:51 PM
Hey addenkik,
You can create a UI Action form button with the folowing script to export the form to pdf :-
Client : ticked
Form Button : ticked
Onclick : exportPDF()
Script :
function exportPDF() {
var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var a='https://dev00000.service-now.com/';
var url = a+sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;
g_navigation.openPopup(url);
}
NOTE : In var a write your own developer instance url.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2021 04:17 AM
I want the same thing but instead of PDF I want to export form data to Excel. Can you please guide me for this?
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2019 02:43 AM
how to create export to PDF as a button on incident form