Hello Awesome Readers!
Have you ever wanted to make your Salesforce forms more visually interactive? Imagine seeing a green icon when a claim is approved or a red one when it’s rejected. That’s exactly what we’re diving into today!
In this quick tutorial, I’ll walk you through how to dynamically change the color (via images) of a field in a Salesforce claim form—based on the Status of the case. Let’s get into it!
The Requirement:
We want to update the field color based on the "Status" field in a case. For example:
Green when the status is "New"
Red when the status is "Escalated".
The Solution – Step-by-Step
1. Download Your Color Icons
First, grab or create two simple colored icons (in PNG format). Let’s say:
Green dot for New status
Red dot for Escalated status
2. Upload Green Icon as a Static Resource
Head over to Setup > Static Resources, and upload your green ic
3. Upload Red Icon as Another Static Resource
Repeat the same for the red icon.
4. Create a Formula Field
Go to the Case object, and create a new field:
Type: Formula
Return Type: Text
5. Add Your Logic in the Formula
Now, let’s write the logic to display different images based on the status.
Here’s a simple example:
IF(
ISPICKVAL(Status, "New"),
IMAGE("/resource/GreenColorResource", "New", 20, 20),
IF(
ISPICKVAL(Status, "Escalated"),
IMAGE("/resource/RedColorResource", "Closed", 20, 20),
""
)
)
This formula checks the value of Status and shows the corresponding image.
6. Save and Test!
Now go back to a case record and try changing the status.
On status New.
That’s It!
And there you have it—your field now visually reflects the case status with colorful icons. This is not just eye-catching but can also improve user experience by helping teams instantly recognize claim states.
Was This Helpful?
If this guide helped you or gave you an idea for your own org, drop a comment or give it a thumbs up! I'm always happy to share more Salesforce tricks with you.
Happy Salesforce-ing!
— Ambrish
Comments
Post a Comment