Ask Search:
Nathan TimmNathan Timm 

SLA help based on record type

Hi Everyone, I need some help with an SLA formula.

If record type is A through F then return "8"... if not, then 0.

If record type is Y or Z return "16"... if not, then 0. Please help!

IF(
OR(
CASE(RecordType.DeveloperName =
"Type A", 8,0
"Type B", 8,0
"Type C", 8,0
"Type D", 8,0
"Type E", 8,0
"Type F", 8,0
"Type Y", 16,0
"Type Z", 16, 0
)
)
Best Answer chosen by Nathan Timm
Jeff MayJeff May
You are very close:
 
CASE(RecordType.DeveloperName,
"Type A", 8,
"Type B", 8,
"Type C", 8,
"Type D", 8,
"Type E", 8,
"Type F", 8,
"Type Y", 16,
"Type Z", 16,
0
)

 

All Answers

Renaud GambaRenaud Gamba
Hi Nathan,
CASE( RecordType.DeveloperName ,
 "A", 8,
 "B", 8, 
 "C", 8, 
 "D", 8, 
 "E", 8,
 "F", 8,
 "Y", 16,
 "Z", 16,
 0)


Renaud
Jeff MayJeff May
You are very close:
 
CASE(RecordType.DeveloperName,
"Type A", 8,
"Type B", 8,
"Type C", 8,
"Type D", 8,
"Type E", 8,
"Type F", 8,
"Type Y", 16,
"Type Z", 16,
0
)

 
This was selected as the best answer
Steve DoddSteve Dodd
Try this...
CASE(
RecordType.Name, 
'Type A', 8, 
'Type B', 8,
'Type C', 8,
'Type D', 8,
'Type E', 8,
'Type F', 8,
'Type Y', 16,
'Type Z', 16,
0)

You can use RecordType.DeveloperName but you have to make sure your formula is using the correct syntax:

'Type_A_Record Type' (or whatever your record type's developer name is)
Nathan TimmNathan Timm
I would mark all as best answer if I could! Thank you everyone!
Nathan TimmNathan Timm
@jeff may @renaud gamba This doesnt seem to be populating the SLA field. I wonder if its becuase its not an "IF" statement? 
Jeff MayJeff May
Where are you using this formula?
Nathan TimmNathan Timm
@jeff may On a custom object I built. I created this text formula field that returns a number on there so my business hour formula can look at the SLA field. If Business hour exceeds SLA, kind of scenario. 
Jeff MayJeff May
Since you have the formula field with the right value, how are you using that field value in your SLA calculations?
Nathan TimmNathan Timm
Business hour field ticks. Once business hour and SLA equal the 8 or 16, I am going to have an email trigger. 
Nathan TimmNathan Timm
@jeff may
Jeff MayJeff May
So, your formula field is your SLA?   
Nathan TimmNathan Timm
Yes, the one I have mentioned here in my question
Jeff MayJeff May
If the formula is showing a 0, then that means the record doesn't meet any of the CASE values you have specified.
Nathan TimmNathan Timm
@jeff may thats weird, becuase it is showing 0 but all those vlaues do exist as record type names..
Jeff MayJeff May
If you add the record type to the page layout you can see what the exact name is for each record
Nathan TimmNathan Timm
Yeah, I did that just to be sure that record types were linking properly. 
Jeff MayJeff May
If you are using "Developer Name", make sure you replace all the spaces with underscores in your CASE strings.
Nathan TimmNathan Timm
Awesome! That did it! Appreciate your time and patience!
Jeff MayJeff May
Cool.  Enjoy!