On standard Account page I have a text field,and my requirement is that Font colour of text should be change as per values entered. For eg if i enter 1 or 2, Font colur should be Red, for 3 or 4 Green.. Thanks in advance..

  • this can also be done with a VF page override to the standard page using apex:detail plus some jQuery to color values as needed.
    – cropredy
    Commented Jul 21, 2015 at 16:42

3 Answers 3


You cannot change the font color using the standard page layout, you would need to use a custom visualforce page but as an alternative you could conditionally render images in a formula see this thread here:https://developer.salesforce.com/forums?id=906F00000008wMbIAI

  • ok. Now i have created a formula field to display image on saving value in piclist. Bt in ma pick list there are 20 values and its not feasible solution to add 20 images in Static resource . I trie with Zipping a imges in folder but does not work..
    – Priya
    Commented Jul 17, 2014 at 12:53
  • Usually the folder name needs to be included in the image file path. Edit your post to show us your code if you can't get it sorted.
    – crmprogdev
    Commented Jul 17, 2014 at 12:58
  • Yeah its done via Formula field.:)
    – Priya
    Commented Jul 21, 2014 at 10:41

Well I think it is possible by embedding a Visualforce page on the standard layout to display only the fields for which you want the conditional formatting.

Or if possible use formula fields to denote images based on your criteria.

Or another "hack" is to have a hidden visualforce page that has some Javascript to get the ID of the element you want to change the color of, and change its CSS. Although it might not be a very safe idea, considering that the ids/class names on the page might change without notice.

  • Yeah its done via formula field..
    – Priya
    Commented Jul 21, 2014 at 10:41

I've borowed part of this answer from here. It is possible to create a formula field, containing a custom message with a (very) large red font.

Your two options, in terms of formulas are

referencing another cell containing the error message

+ Original_Alert_Field__c,

writing the message in the formula

+ "your alert","")

Obviously you can add If conditions to your formula, based on your criteria to determine whether or not the alternative font should apply.


The syntax for these fonts is


For example


produces (Close Date Alert is the name of my field)

red text




blue text

see the Google reference guide for more details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .