Here are some best practices and methods to improve the creation and maintenance of formula fields:
- Formatting with carriage returns and spacing
- Commenting
Here are some best practices and methods to improve the creation and maintenance of formula fields:
Consider the following formula:
Sales Tax (Percent) = IF(TEXT(Account.Market__c) = "US", IF(TEXT(Account.State__c) = "California", 0.0925, IF(TEXT(Account.State__c) = "Nevada", 0.081, IF(TEXT(Account.State__c) = "Utah", 0.0835, 0) )) , 0)
To improve the readability of formula fields, you can add spacing and carriage returns. The preceding formula can be made far easier to understand simply by adding spaces and carriage returns, as follows:
...