function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Zakir  HussainZakir Hussain 

Implementing

Hi All,

  I have created a custom object. Whenever we create a record, by using Notes & Attachments I'm attaching a pdf file to it. Now my requirement is, whenever user attaches a PDF file to a record, on the backend I need to run a process which will convert the attachment into PDF stream and send to third party system. 

  Can anyone help me on this like how can i apparoch to it !!!
PratikPratik (Salesforce Developers) 
Hi Zakir,

You can write a trigger on attachment and call the class in trigger which will have logic to convert attachment in pdf and send to third party.

for trigger sample code:
https://help.salesforce.com/HTViewSolution?id=000181538&language=en_US

hope this will help you to get started.

Thanks,
Pratik
Zakir  HussainZakir Hussain
Thanks Pratik for your reply... Actually whenever any attachment is uploaded, it will be stored in a folder(location) right. So now I want to have a plugin which will monitor the folder and verify all the attachments in that. If it finds any PDF format files, it has to send them to third party system. Do we have any out of box thing in sales force for this. Or do we have to code Apex.... Can we develop a java plugin for this? If yes, then how can we incorpiorate Java plugin in sales force?

Appreciate your reply on this....
Andreas MeyerAndreas Meyer
Hi Zakir,

Pratik is right .. you have to write an attachment trigger (which means to code APEX) to handle all new added attachments. In fact attachments are salesforce objects with a parent which is an account, case etc. So there is no folder or location to scan and you cannot develop a java plugin for it. If you like to handle existing attachments a (scheduled) batch job might be a solution .. otherwise the trigger is exactly what you are looking for.

Best,
Andreas
PratikPratik (Salesforce Developers) 
Thanks Andreas for the amendment.

regards,
Pratik
Zakir  HussainZakir Hussain
Hello Pratik/Andreas,

 I tried to code apex trigger to meet my requirement. As I'm new and learning by self, not able to code exactly to meet my requirement. Can anyone of you provide me the code that will help me to meet the above requirement.