Send Notification with PDF attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 11:07 PM
Hi,
As per my requirement I want to send a notification with PDF attachment. That PDF will contain details of 'Demand' form, Its not an external file.
There is UI Action button on form, once clicked it should trigger a notification to client with current form details in PDF attachment.
Any suggestions how to achieve this.
Thanks in Advance
Regards
Arun Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2017 11:43 PM
Hi Arun,
I suggest you to create a registry and generate an event when clicked on UI Action this will help you to configure the email notification along with "Include attachments". Please refer the below links where you to generate the form to PDF before sending email.
I am a creator — PDF Document Generator - Walter Brame
Sending Documents in an Email Notification
Mark this as answered, helpful if above information help you to resolve your query
Regards
Prashant

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2017 12:47 AM
Hey Arun,
I suggest you to create a registry and generate an event when clicked on UI Action this will help you to configure the email notification along with "Include attachments".
And write this code on UI Action -
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();
That code will convert form into PDF and attached to the attachments.
NOTE -
USERID and PASSWORD will be of ADMIN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 03:13 AM
Hi Nayan,
Thanks for reply.
But when I'm trying to implement suggested logic "sn_ws is not defined" error is triggering. Below are my codes which I'm trying to execute using "UI Action" and Screen shot.
function dmCIO_signOff(){
try{
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();
gsftSubmit(null, g_form.getFormElement(), 'dm_cio');
}
catch(e){
alert('Degital WO UI Action : '+e);
}
}
if (typeof window == 'undefined')
closeDMTask_cio();
function closeDMTask_cio()
{
current.state = 3;
current.update();
action.setRedirectURL('./u_demand_request.do?sys_id='+current.u_parent_demand);
}
Please suggest how to handle 'sn_ws is not defined' error.
Thanks in Advance
Regards
Arun Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2017 03:38 AM
Check
Scripted REST API Plugin is active or not?