Recommended Practices for Writing Formulas in Salesforce

Here are a few recommended practices when writing formulas in Salesforce

Start a new line for each Function

Rather than writing your entire formula on one line (no matter how small) get into the habit of putting each function on a separate line. This will help to improve the readability and clarity of your formulas for yourself and anyone else who might need to look at it in future.

It also helps when trying to troubleshoot issues with your formula.

Indent sections within parentheses

Indent the formula whenever you hit a an open bracket “(“.

This is another tip that will help make your formula easier to read and troubleshoot.

Write Functions in Upper Case

This will have the simple effect of helping you easily identify your functions from your parameters.

Use an Enhanced Formula Editor extension

There are many Enhanced Formula Editors available for Salesforce in the Chrome extension store. These give you added visibility into your formulas by colour coding etc.


Resources

Best Practices for Formatting & Fixing Formulas in Salesforce