Print to PDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 02:11 AM
Team ,
Requirement is we need to create UI action in particular table to print the all fields in the table
can someone help me ..how i can achive this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 02:15 AM
Hello @pramn
Add this script in your UI Action, this will create the PDF of the current record and attach to same
var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
var url = gs.getProperty("glide.servlet.uri") + current.getTableName() + '.do?PDF&sys_id=' + current.sys_id;
rm.setEndpoint(url);
rm.setBasicAuth(gs.getProperty('glide.user.userid'), gs.getProperty('glide.user.password'));
rm.saveResponseBodyAsAttachment(current.getTableName(), current.sys_id, current.number + ".pdf");
var response = rm.execute();
action.setRedirectURL(current.getTableName()+'.do?sys_id='+current.sys_id);
Please check and Mark Helpful and Correct if it really helps you.Regards,
Prashant Ahire
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 02:28 AM
Thanks Pranshant ..could you please guide me how to create it on workspace ...
need your guidence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:21 AM
where I am doing wrong >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 02:40 AM
- Go the table where you want the UI action, click on the additional action, then Click on UI action
- Now Give the name for the UI action.
- check on the form button or form context menu as per your requirement
- now add the script in the script section that i have mentioned above.
- Save the action and test
Please mark helpful