Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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..

share|improve this question
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 Jul 21 '15 at 16:42

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:

share|improve this answer
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 Jul 17 '14 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 Jul 17 '14 at 12:58
Yeah its done via Formula field.:) – Priya Jul 21 '14 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.

share|improve this answer
Yeah its done via formula field.. – Priya Jul 21 '14 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.