Export to PDF UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2012 08:42 PM
Hi Everyone,
Can you please tell me how to create a UI Action(Export to PDF) on ESS Portal for exporting the form(UI Page) in PDF Format, Actually we have to give functionality to user to extract the form from ESS Portal related to certain category and then use it in PDF Format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2016 02:52 AM
Brian thanks for your really.Actually I have 17000 records which has columns of 3 tables with images.Can it support to fulfill my need ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2016 03:30 PM
Jonathan,
I am trying to do something a bit different but I think similar.
I am attempting to create a pdf of a record and attach it to itself.
The attach to itself part is working but the content of the pdf is all wrong.
I am doing this in a UI action, any pointers would be greatly appreciated!
--------------------
var attachment = new Attachment();
var attachmentRec = attachment.write('u_wacky_table', current.sys_id, (current.number), "application/pdf",'g_form.'+'u_wacky_table'+'.do?PDF&sys_id=' + current.sys_id);
gs.addInfoMessage(attachmentRec);
------------------------------
thank you
Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2016 04:11 PM
Brian,
When you say the content is all wrong do you mean the fields displayed are wrong or is the file damaged and not opening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2016 04:16 PM
I don't think the content is acccepted. The pdf fails.
Sent from Yahoo Mail on Android
On Tue, Sep 6, 2016 at 4:11 PM, jonathanjacob<community-no-reply@servicenow.com> wrote:
a body {font-family:Helvetica, Arial, sans-serif;} h1, h2, h3, h4, h5, h6, p, hr {}.button td {}
|
|
|
Export to PDF UI Action
reply from Jonathan Jacob in User Interface - View the full discussion
Brian,
When you say the content is all wrong do you mean the fields displayed are wrong or is the file damaged and not opening?
Reply to this message by replying to this email, or go to the message on ServiceNow Community |
Start a new discussion in User Interface by email or at ServiceNow Community |
Following Export to PDF UI Action in these streams: Inbox |
.footerlinks
|
This email was sent by ServiceNow Community because you are a registered user. You may unsubscribe instantly from ServiceNow Community, or adjust email frequency in your email preferences |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2016 04:26 PM
So the easiest way to do so is using a Rest Message via the UI action:
(also I see you are mixing client/server APIs... g_form is a client side API... Attachment, restMessage and gs. are server side APIs.) Make sure your UI action runs server side.
var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
rm.setEndpoint(current.getTableName()+ '.do?PDF&sys_id=' + current.sys_id);
rm.saveResponseBodyAsAttachment(current.getTableName(),current.sys_id,fileName);
var response = rm.execute();
if(response.getStatusCode()==200) {
// gs.addInfoMessage('Added attachment!');
}
See the following for more info: