You need to sign in to do that
Don't have an account?
ellsajames11.3892668100636045E12
Copy image from a Rich Text Area field to a field on a related object?
I am trying to pull an image from a Rich text area field on Account object to a field on a related custom object. Has anyone done this before or have any advise on the easiest way to do it?.
Basically, the data from the standard Account object is being pulled across (via formula fields) to a related custom object. I am struggling with pulling accross the image from a rich text area field.
Any ideas on best practice for doing this?
Basically, the data from the standard Account object is being pulled across (via formula fields) to a related custom object. I am struggling with pulling accross the image from a rich text area field.
Any ideas on best practice for doing this?
The only possible solution i could list down is: http://salesforcetrick.blogspot.in/2013/06/converting-rich-text-area-fields-image.html
Apart from this, i doubt there could be another way to achieve this requirement.
Workaround: Store images in documents and access it from folder.
This would be in apex code:
String newValue = badValue.replace('feoid='+idOfSourceField, 'feoid='+idOfTargetField);
Here is what i did for my VF page, and my RTF only contains Images no other text. You might want to see if this helps you out. I'll be glad to help you on this if you have questions.
<!-- Retrieve the full length of the Article Image -->
<apex:variable value="{!Len(News.newsKavObj.Article_Image__c)}" var="len"/>
<!-- Find the src starts, then add 5 to retrieve the start of the SRC URL -->
<apex:variable value="{!FIND("src", news.newsKavObj.Article_Image__c)+5}" var="mid"/>
<!-- Do a mid function to get the start of the Src URL and the remaining URL based off the MID and Len Variables-->
<apex:variable value="{!MID(news.newsKavObj.Article_Image__c, mid, len)}" var="source"/>
<!-- Find the first " mark appearing in the source variable then using subtract 1 to find the MidEnd -->
<apex:variable value="{!FIND("\"",source)-1}" var="midEnd"/>
<!-- Now do a MID function that will take the first mid and midEnd, this will be the final Src URL for the Article Image -->
<apex:variable value="{!MID(news.newsKavObj.Article_Image__c, mid, midEnd)}" var="finalsrc"/>
My scenario is to copy the richtextarea field from custom object to standard object(User) richtextarea (custom) field.
I have done this by using cloning..
Here is the example of single record. You can use map for multiple record.
Xxx__c: custom obj.
Image_xxx__c: richtextfield.
So now user will have image from Xxx__c's Image_xxx__c field.
Mark this as best answer if its helps.
Thanks.
Praveen Murugesan.