The Swamps of Salesforce-Dagobah

Random Discovery – Record Type Fields in Formulas

Advertisements

If you’re like me, it’s sometimes easy to forget what options and services are available to you if you can’t see them. Case in point: being able to use Record Type fields in formulas.

This is a feature that was released only a year ago, but yesterday, I discovered that it’s not readily apparent EVERYwhere.

Here’s what the interface looks like when making a formula on a custom object:

But here’s what it looks like when making a formula in Case:

Wait, what’s missing here? There’s no Record Type > ! And upon further research, I found it was not present in any of the Standard Objects I looked in: Cases, Accounts, Opps.

Does this mean that the functionality was not present in those Standard Objects? Breathe a sigh of relief, for the answer is, you CAN still use it. To test this, I manually typed in “RecordType.Name”, hit the Check Syntax button, and got the following result:

So there you have it. It WORKS, but it’s just not in the UI for Standard Objects. And frankly, it’s telling, regarding the overwhelming number of things we can do in Salesforce, the sheer scope of possibility, that only a year after release it’s so easy to forget that this feature was released.

Here are the values you can manually type into Standard Object formulas, validation rules, and workflow to reference Record Type information:

RecordType.Name
RecordType.NamespacePrefix
RecordType.Id (but avoid this one whenever possible!)
RecordType.DevName (I prefer using this one over RecordType.Name, because this is the API name and as a result, is in far less danger of being changed by a well-meaning admin.)

Advertisements