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
vijayk1.393339369954256E12vijayk1.393339369954256E12 

Rich Text Field Issue

It is possible to get image file from Rich Text Field value. 

Thanks in advance
Nirmal ChristopherNirmal Christopher
Where you have to get it in the visual force page? if you use apex output text in visual force page. the output value does'nt support any formatting. May be you can use a formula field to copy all the values from the rich text field and use the formula field to get the value. try this it may help.
vijayk1.393339369954256E12vijayk1.393339369954256E12
I just want to retrieve the image and push into production rich text field
SRKSRK
you can try to get the body of rich text box it may return you a blob the you can use decodeBase64 or encodebase64 salesforce class to proecess the blob body of rich text box
Nirmal ChristopherNirmal Christopher
Hello SRK, How can we retreive the body of a rich text field. Can you please  share the code. As per my knowledge the rich text box will store its contents as a string.
SRKSRK
We can use StandardController on VF page to get the Field data in VF page and then usgin Javascript or just try to fatch the innher HTML from the rih text file 

I belive it rturn you a string that we can pass to encodeBase^4 method to create a image blob and the can save the blob as image in document 
Nirmal ChristopherNirmal Christopher
Once we extract the body then we can parse it to the blob content i will experiment it shortly thanks for the info
vijayk1.393339369954256E12vijayk1.393339369954256E12
When we quaried the field it will give the value

<img alt="User-added image" height="375" src="https://c.ap1.content.force.com/servlet/rtaImage?eid=0019000000Swx0N&feoid=00N90000009D4EY&refid=0EM90000000YD0S" width="500"></img>

This is only the string containing the image location and src image path but not the image.

How can we encode the image file with this field value
SRKSRK

what will happen if you use input field on page does it give the blob containt ??

 

Tarun Khandelwal 1Tarun Khandelwal 1
Hi Vijay,
Did you find the solution to copy/merge image from the field. I need to migrate the field value from 1 record to other, but I am getting the field from describe call and cannot use standard controller or any visualforce page as this is a background process.