Salesforce Fact #333 | CASE efficiency in formula

Do you know while using picklist field value with CASE statement in formula field, we do not need to use TEXT() or any other function to get the expected value. Other advantage of using CASE statement is that unlike IF statement we do not need to refer the same field multiple times in ISPICKVAL function to check for the values. This saves the character count on formula field. Also number of parentheses is also less in CASE statement which leads to easier debugging.

In this example, we have a number formula field Score which populates a numeric value based on the type of the account.

Attached are the screenshots of both the versions.




Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow