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
Matthew AllenMatthew Allen 

formula to visualforce

I have a formula that shows images based on whether certain text is found in a text field. The problem I have is that there are about 30 different images needed and doing it as a formula field exceeds the formula size limit.

Can someone help me replicate this as a visualforce page?

The formula below just shows 3 brands, but if I can get this to work, I can then rework the code to include the others

CONTAINS( Brand_Concat_Group__c ,"Audi"),
IMAGE("", "Audi", 80, 100),
) & " " &
IMAGE("", "BMW",80,100),
) & " " &
IMAGE("", "Fiat",80,80),

Thank you

Avishek Nanda 14Avishek Nanda 14
Hey  Matthew,

Instead of using formula field you could add the images to static resources and have them populated on VF page based on your criteria. 
Define Your criteria in your Apex controller and have the image populated on VF Page.

Remember, you can add VF page to standard details page only. Which mean the page will show after the record is saved. 

Let me know if this helps. Mark this as best answer. 
Matthew AllenMatthew Allen
Yes, thats what I have asked help for. Can you help tell me how to do it?

I have done this -
<apex:page standardController="Account" sidebar="false" showheader="false" readOnly="true">
  <div style="text-align:center;font-size: 25px;">


<apex:form >
<table width="100%"> 
    <td style="width:10%"><apex:image id="Abarth" value="{!IF(CONTAINS(Account.Brand_Concat_Centre__c ,"Abarth"), $Resource.LogoAbarth, Null)}" width="100" height="100"/></td>
    <td style="width:10%"><apex:image id="Audi" value="{!IF(CONTAINS(Account.Brand_Concat_Centre__c ,"Audi"), $Resource.LogoAudi, Null)}" width="100" height="100"/></td>
    <td style="width:10%"><apex:image id="BMW" value="{!IF(CONTAINS(Account.Brand_Concat_Centre__c ,"BMW"), $Resource.LogoBMW, Null)}" width="100" height="100"/></td>


but it shows a blank box if the Brand isn't contained in the Brand_Concat_Centre__c field?

Any ideas how I can convert my formula in the original post into a VF Page?