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

Using Image formula field in VisualForce page
Hi, i am new to using visualforce and i am trying to create a detail page to overright the current detail page for a custom object. The custom object contains a picklist field containing 3 values. I have created a custom formula field using Image and Case to display the values in the picklist as images in the detail view. the formula in the field is:
IMAGE(
CASE( Status__c ,
"Not Received","https://emea.salesforce.com/resource/1242640894000/RedFlagStatus",
"Received", "https://emea.salesforce.com/resource/1242641297000/YellowFlagStatus",
"Checked","https://emea.salesforce.com/resource/1242641338000/GreenFlagStatus",
"Status"),
"Status")
In my visualforce page i am using <apex:outputField value="{!CustomObject__c.Status__c"/> to display the custom formula field. However the imgae is not displaying, instead it has, <img src="https://emea.salesforce.com/resource/1242641297000/YellowFlagStatus" alt="Status" border="0"/> in the field output. If anyone can help with how i should display the picklist values as images on the detail page of a record then that would be great.
Matt.
I was able to do it with outputText and specifying escape parameter as false:
<apex:outputText value="{!Object.ImageFormulaField__c}" escape="false"/>
Regards!
All Answers
Try something similar to this:
<apex:column Value="{!c.status}" style="{!IF(c.Status='New', 'color:brown;font-weight: bold',IF(c.Status='In Progress', 'color:green;font-weight: bold',IF(c.Status='Triaged', 'color:orange;font-weight: bold',IF(c.Status='On Hold','color:red;font-weight: bold',IF(c.Status='Resolution Provided','color:blue;font-weight: bold',IF(c.Status='Closed - Duplicate','color:black;font-weight: bold',IF(c.Status='Closed','color:black;font-weight: bold','color:grey')))))))}"/>
I was able to do it with outputText and specifying escape parameter as false:
<apex:outputText value="{!Object.ImageFormulaField__c}" escape="false"/>
Regards!
#awesome - Thanks - just what I needed in a pinch!
i am also thnakfull !!
Don't forget to set the remote site settings for URLs outside of Salesforce in Your Name | Setup | Security Controls | Remote Site Settings.