We have a formula field that displays images based upon the custom object's record type and a picklist value.
This formula field is like
IF( $RecordType.Name = "XYZ", IMAGE(
CASE(
Status__c ,
"FIRST","/resource/first",
"SECOND", "/resource/second",
"THIRD", "/resource/THIRD",
"/s.gif"),
"DEFAULT")
The above works well and displays images as expected.
We want to explore whether instead of using "FIRST", "SECOND" etc..can we use custom labels.
The custom label's name is First and its value is FIRST.
I tried the following without success
1)
IF( $RecordType.Name = "XYZ", IMAGE(
CASE(
Status__c ,
$Label.First,"/resource/first",
"SECOND", "/resource/second",
"THIRD", "/resource/THIRD",
"/s.gif"),
"DEFAULT")
Result : Getting the following error
"Error: Incorrect parameter type for function 'CASE()'. Expected , received Text"
2)
IF( $RecordType.Name = "XYZ", IMAGE(
CASE(
TEXT(Status__c) ,
$Label.First,"/resource/first",
"SECOND", "/resource/second",
"THIRD", "/resource/THIRD",
"/s.gif"),
"DEFAULT")
Result : Formula field gets successfully compiled but the image is not being shown.
I searched online and I could not find any actual examples of $Label being used in formula fields though there are examples of $Label being used in VF pages.
Can someone help me on this ?