You need to sign in to do that
Don't have an account?
Matthew Allen
formula to visualforce
Hi,
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
IF(
CONTAINS( Brand_Concat_Group__c ,"Audi"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024589000/AUDI", "Audi", 80, 100),
null
) & " " &
IF(
CONTAINS(Brand_Concat_Group__c,"BMW"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024614000/BMW", "BMW",80,100),
null
) & " " &
IF(
CONTAINS(Brand_Concat_Group__c,"Fiat"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024641000/FIAT", "Fiat",80,80),
null
)
Thank you
Matt
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
IF(
CONTAINS( Brand_Concat_Group__c ,"Audi"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024589000/AUDI", "Audi", 80, 100),
null
) & " " &
IF(
CONTAINS(Brand_Concat_Group__c,"BMW"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024614000/BMW", "BMW",80,100),
null
) & " " &
IF(
CONTAINS(Brand_Concat_Group__c,"Fiat"),
IMAGE("https://c.eu10.visual.force.com/resource/1521024641000/FIAT", "Fiat",80,80),
null
)
Thank you
Matt
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.
I have done this -
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?