Adding Custom Color Flag Fields in Salesforce

Salesforce no longer allows you to create custom fields with custom background colors. However, you can add images to custom fields. Let’s say you wanted to create a custom field to identify case age in business hours. For this example, we’ll identify a case opened within 24 hours with a green flag, a case opened within 48 hours with a yellow flag and a case opened longer than 48 hours with a red flag.
You’ll need to create a customer formula field with a Text return type. The code below will add the flag icons along with the number of hours the case has been opened.