You need to sign in to do that
Don't have an account?
Developers
How to attach files for document object by using apex code?
Hi,
Can any one tell me that how to attach file while creating document by using apex controller code?
I need to automate the process of replacing the document daily wise. Instead of that, we decided to make this as automated process by using E-mail services.
I am able to create the record under document. But, i could not able to attach the file which is available in the email attachment.
Please help me in this how to upload that email attachment for the document record.
Thanks in advance.....
Regards,
Phanikumar
Hello Phanikumar,
Please find below link which has example explaining how to retrieve email attachments and associate them with records:
http://developer.force.com/cookbook/recipe/retrieving-email-attachments-and-associating-them-with-records
replace jobApplications with document object.
Also refer:
http://salesforce.stackexchange.com/questions/11841/is-there-a-superclass-for-document-and-attachment
http://salesforceapexcodecorner.blogspot.sg/2011/09/attach-document-in-attachment-object.html
Hope this helps!
just go through these links
http://blog.jeffdouglas.com/2010/04/28/uploading-an-attachment-using-visualforce-and-a-custom-controller/
http://salesforceapexcodecorner.blogspot.in/2011/09/attach-document-in-attachment-object.html
http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller