The Now Platform® Washington DC release is live. Watch now!
03-21-2017 03:29 AM
Suppose I am entering some data in a form of table u_candidate_details and when i submit or save the form a record will be inserted in table u_candidate_database and a pdf attachment will be added on the record that was created on table u_candidate_database . the attachment will be pdf of the form view u_candidate_details
Solved! Go to Solution.
03-21-2017 04:02 AM
Hey Suprakash,
Write a INSERT BUSINESS RULE -
var gr = new GlideRecord ('u_candidate_database');
gr.addQuery(Filter_condition);
gr.query();
if(gr.next())
{
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(gr.getTableName(),gr.sys_id,current.number+".pdf");
var response = rm.execute();
}
03-21-2017 04:02 AM
Hey Suprakash,
Write a INSERT BUSINESS RULE -
var gr = new GlideRecord ('u_candidate_database');
gr.addQuery(Filter_condition);
gr.query();
if(gr.next())
{
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(gr.getTableName(),gr.sys_id,current.number+".pdf");
var response = rm.execute();
}
03-21-2017 04:23 AM
Hello Nayan,
I have a similar requirement when ever i fill a form say "Incident" table and all the filled info should be converted into PDF and send attached email to any given user say azeez@example.com
could you please help me out ?
03-21-2017 04:37 AM
Hey Abdul,
Using above code you can create PDF and attach to the Incident form.
when PDF is attached fire a event which will trigger a NOTIFICATION and on notification there is a checkbox named as INCLUDE ATTACHMENTS.
After event delete the FORM PDF from the INC RECORD.
03-21-2017 04:45 AM
Do you mind to give lil more info/steps regards to notification PLEASE ?