You need to sign in to do that
Don't have an account?
aparkman
Image Formula field referenced in Visualforce page
Hello,
I have an image formula field on Case which is showing one of the standard Salesforce flags (grren, yellow, or red) based on the time remaining on when the case should be resolved The formula for this field is below:
IMAGE(
IF((Minutes_to_Deadline__c > (SLA_Minutes_2__c * 0.25)),"/img/samples/flag_green.gif",
IF(Minutes_to_Deadline__c < 0, "/img/samples/flag_red.gif",
IF((Minutes_to_Deadline__c > 0 && Minutes_to_Deadline__c <=(SLA_Minutes_2__c * 0.25)) , "/img/samples/flag_yellow.gif",""
))),"None")
I am now trying to reference this field in a Visualforce page in the case console. I am able to save the page with this field in the code, but when I open the console and look at the component which is built from the visualforce page, it outputs the url of image (e.g. "/img/samples/flag_red.gif") instead of the image. I believe this was because I had "apex:outputText" in the code:
<apex:outputText value="{!con1.Case_SLA__c}"/>
I then changed this to be (although i know I'm missing something):
<apex:image id="flag" value="{!con1.Case_SLA__c}"/>
It now only shows a broken image.
Does anyone know how I can get this to show the flag that is in the formula field? Or do I have to put logic in either the Visualforce page or Controller to show what I want it to show?
Thanks,
Adam
I have an image formula field on Case which is showing one of the standard Salesforce flags (grren, yellow, or red) based on the time remaining on when the case should be resolved The formula for this field is below:
IMAGE(
IF((Minutes_to_Deadline__c > (SLA_Minutes_2__c * 0.25)),"/img/samples/flag_green.gif",
IF(Minutes_to_Deadline__c < 0, "/img/samples/flag_red.gif",
IF((Minutes_to_Deadline__c > 0 && Minutes_to_Deadline__c <=(SLA_Minutes_2__c * 0.25)) , "/img/samples/flag_yellow.gif",""
))),"None")
I am now trying to reference this field in a Visualforce page in the case console. I am able to save the page with this field in the code, but when I open the console and look at the component which is built from the visualforce page, it outputs the url of image (e.g. "/img/samples/flag_red.gif") instead of the image. I believe this was because I had "apex:outputText" in the code:
<apex:outputText value="{!con1.Case_SLA__c}"/>
I then changed this to be (although i know I'm missing something):
<apex:image id="flag" value="{!con1.Case_SLA__c}"/>
It now only shows a broken image.
Does anyone know how I can get this to show the flag that is in the formula field? Or do I have to put logic in either the Visualforce page or Controller to show what I want it to show?
Thanks,
Adam
Thanks,
Kaustav
All Answers
Thanks,
Kaustav
Did you try out with this also?
<apex:image id="flag" url="{!con1.Case_SLA__c}"/>
Saransh - what does thes escape="false" do with it?
- < will become <
- > will become >
- & will become &
- etc.
When you disable this with 'escape="false"' then this conversion won't happen.