UI Action to export a form to pdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2011 03:11 PM
I am trying to create a button to export my problem form to pdf. Is it possible to call Export > PDF > Portrait context menu using UI Action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2011 03:54 PM
Put this URL at the end of your instance:
nav_to.do?uri=sys_ui_context_menu.do?sys_id=d1e5d8a50a0a0b3e00459c252c81e649
This is where that code is placed. You should be able to reuse it for your needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2011 05:30 AM
- 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();
}