ShowAll Questionssorted byDate Posted
Nathan 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(
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 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
)```

Renaud 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 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 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 Timm
I would mark all as best answer if I could! Thank you everyone!
Nathan 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 May
Where are you using this formula?
Nathan 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 May
Since you have the formula field with the right value, how are you using that field value in your SLA calculations?
Nathan Timm
Business hour field ticks. Once business hour and SLA equal the 8 or 16, I am going to have an email trigger.
Nathan Timm
@jeff may
Jeff May
Nathan Timm
Yes, the one I have mentioned here in my question
Jeff 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 Timm
@jeff may thats weird, becuase it is showing 0 but all those vlaues do exist as record type names..
Jeff May
If you add the record type to the page layout you can see what the exact name is for each record
Nathan Timm
Yeah, I did that just to be sure that record types were linking properly.
Jeff May
If you are using "Developer Name", make sure you replace all the spaces with underscores in your CASE strings.
Nathan Timm
Awesome! That did it! Appreciate your time and patience!
Jeff May
Cool.  Enjoy!