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
sreekanth reddysreekanth reddy 

Hi my requirement is php to salesforce integration. in php form submitted the data will be saved in lead.all field are saved but how to save fileupload field to attachments in salesforce

Pls help me
Thanks!
 
Best Answer chosen by sreekanth reddy
RishavRishav

Hii Sreekanth,
First thing you need to remember is that if you want to upload a file in salesforce and store it in attachmnt object then you will have to provide
a parent ID with this. Parent ID can be Lead, account,contact,oppoortunity,Case,Ideas, Etc.  So you will have to provide one record id of any object as parentId (attachment.parentid= recordid) .
So please use the newly created recordID of lead as a parent id of attachment then insert the attachment. with this process ur problem will be solved

Thanks
Rishav

All Answers

RishavRishav

Hii Sreekanth,
First thing you need to remember is that if you want to upload a file in salesforce and store it in attachmnt object then you will have to provide
a parent ID with this. Parent ID can be Lead, account,contact,oppoortunity,Case,Ideas, Etc.  So you will have to provide one record id of any object as parentId (attachment.parentid= recordid) .
So please use the newly created recordID of lead as a parent id of attachment then insert the attachment. with this process ur problem will be solved

Thanks
Rishav

This was selected as the best answer
sreekanth reddysreekanth reddy
thanks for responce
Hi my requirement is php to salesforce integration. in php form submitted the data will be saved in lead.all field are saved but how to save image field  in salesforce.
RishavRishav
Hii,
 You can create a rich text-box field in which you can save your image. 
sreekanth reddysreekanth reddy
Hi!
I am trying That one But its comming image name only
Image not displayed
Thanks!!!!!!!