+ Start a Discussion
hema k 29hema k 29 

How Can I store Rich Text Area field(Image) of a custom object into document object

I have a trigger to insert document record whenever Contact 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 the document?
Murali MattaMurali Matta
Hi Hema,

Hope these links can help you.



Let me know if you have any confusion.

Kindly mark this as solved if the reply was helpful.

Bhargavi TunuguntlaBhargavi Tunuguntla
Hi hema

Please try refering the below link:


This will extract the image from RichTextArea and you can save it to documents.
Let us know if it was helpful.

hema k 29hema k 29
I wrote the Apex code and call the apex method into trigger while inserting a record in the contact object its showing error, execution of AfterInsert caused by System.VisualforceException: Getting content from within triggers is currently not supported.: Class.DocumentRecord.beforeinsert: line 22, column 1 please help me, This my code : PageReference pageRef = new PageReference(container); string strFolderId = '0057F000002mY3w'; Document doc = new Document(); doc.Name = 'pic12'; doc.Type = 'png'; doc.Body = pageRef.getContent();