You need to sign in to do that
Don't have an account?

How to upload image from my local system to custom object field which is a Rich Text Area
<apex:page showHeader="false" sidebar="False" controller="InsertOEMIncentive" docType="html-5.0">
<apex:form >
IncentiveType_Name<apex:inputText value="{!IncentiveType_Name}"/><br/>
IncentiveType_Description<apex:inputText value="{!IncentiveType_Description}"/><br/>
IncentiveType_Image<apex:inputFile value="{!IncentiveType_Image}"/><br/>
Incentive_EndDate<apex:input type="date" value="{!Incentive_Type_EndDate}"/><br/>
Incentive_StartDate<apex:input type="date" value="{!Incentive_Type_StartDate}"/><br/>
<apex:commandButton value="save" action="{!saveList}"/>
</apex:form>
</apex:page>
<apex:form >
IncentiveType_Name<apex:inputText value="{!IncentiveType_Name}"/><br/>
IncentiveType_Description<apex:inputText value="{!IncentiveType_Description}"/><br/>
IncentiveType_Image<apex:inputFile value="{!IncentiveType_Image}"/><br/>
Incentive_EndDate<apex:input type="date" value="{!Incentive_Type_EndDate}"/><br/>
Incentive_StartDate<apex:input type="date" value="{!Incentive_Type_StartDate}"/><br/>
<apex:commandButton value="save" action="{!saveList}"/>
</apex:form>
</apex:page>
You can acheive this requirement using formula field.What you need to do is u have to store image file in attachment.After that you need to store this image url in custom field which will be hidden from pagelayout.For that you will create two custom field.
1.Custom field Name "StoreImageUrl" which will store image url.
2.Custom field of formula type with Name "Image" which will show ur image on object.(Type:text/Rich Text Area).y
Try below code it is working fine in my org.
Visualforce Page Apex Classes Formula Field (Image)
IF( StoreImageUrl__c != null , IMAGE( StoreImageUrl__c , '' , 100 , 100 ) , IMAGE('' , '' , 0 , 0));
If this will helps out.Mark it best answer to help others
Thanks :)