+ Start a Discussion
shaik ismail 7shaik ismail 7 

How to insert document record when account record is created....?

Hi All,
I have trigger to insert document record when ever account record is created and I have one custom field Image__c which is Ritch Text Area data type, I am storing images in Image__C field, How can get this image__c into document.Can you please help me...
Raj VakatiRaj Vakati
You can able to insert as below  .. here acc is the account reference

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_document.htm
 
 
Document emailDoc = new Document();
emailDoc.Url =acc.Image__c;
emailDoc.Name = 'Test' ;
// add other fields 
insert docToUpdate;

 
shaik ismail 7shaik ismail 7
Thank you, but in acc.Image__c  I stored image but in document object I assigned to emailDoc. URL which is stored as url, I want to store same image in document..