Salesforce provides a formula editor that enables users to perform complex calculations, manipulate data and establish validation rules across its various products, including Sales Cloud, Service Cloud and Marketing Cloud.
With the new and improved formula editor, users can take advantage of numerous features and benefits unavailable in the simple editor.
In this blog, we will explore some of the key features of the Better Salesforce Formula Editor.
Simple Formula VS Better Formula editor
In the simple formula editor, the field and the operators are to be selected from the picklists provided at the top.
In Better Formula Editor we can access all the record fields, Operators and functions which can be used in building the formula and context variables just by clicking on the icons on the right as shown below.
How to install Better Salesforce Formula Editor?
- To find and install Chrome extensions, open Google Chrome browser and go to the Chrome Web Store
In the Chrome Web Store’s search bar search for “Better Salesforce formula Editor”
Click the “Add to Chrome” button to begin the installation process.
A pop-up dialogue will be displayed, prompting you to confirm the installation. To continue, click on the ‘Add Extension’ button.
To understand the key features of Better Salesforce Formula Editor, let’s create a validation rule on the Opportunity object.
Use Case: Create a Validation rule on the Opportunity object to show an error message if the Stage is Closed and the lead source field is blank. Display the error message ‘Please enter the lead Source’ on the Lead source field.
Read more – Salesforce Page Optimizer Extension
Steps to create a validation rule
- Go to object manager and then select the opportunity object.
- On the left-hand side, select the Validation Rules option.
- Click on new and enter the Rule Name as ‘Test Validation 1’.
- Click on the Better Formula tab and type the formula as shown below:
Key Features of Better Salesforce Formula Editor
Auto Complete Function
In the simple formula editor, we had to select the field from a list of fields available on that object. However, the Better Formula editor suggests the fields that are present in your Salesforce organization as you type in the editor box, making it more convenient and efficient.
Hence, it is a significant feature that increases the speed and accuracy during formula creation.
The updated error-handling feature lets users detect syntax errors while writing formulas in real-time. Previously, in the classic formula editor, the entire formula had to be written and the errors were checked using the ‘Check Syntax’ button.
However, with the Better Salesforce formula editor, errors such as missing parentheses are identified while the formula is written. This feature not only makes formula editing more efficient but also saves time.
To compare the formula before and after editing, use the diff mode of the Better Salesforce formula editor. It also helps recover deleted lines.
The new formula editor provides the advantage of syntax highlighting, which is beneficial for businesses as it enhances the readability of formulas and reduces errors in their creation.
Using Better Salesforce Formula Editor, you can indent for the function by using the tab function and it will also automatically indent functions such as IF(), AND() and OR().
As a result, anyone else who sees your formula and also uses Better Formula will be able to understand it more easily as the formula is properly indented.
Even though this might seem like a minor enhancement, the time it saves us from having to scroll through function lists to find the correct structure for a rarely used function is very significant.
What is the Validation Rule in Salesforce?
Validation rules guarantee that the data input by a user into a record complies with specified standards before permitting the record’s saving. These rules assess the data in one or more fields and return a “True” or “False” value.
If the rule returns “True” an error message is shown to the user and the record is not generated.
How do you create a formula field in Salesforce?
- Go to Setup, then to the Object Manager and choose any object for example Opportunity.
Click on Fields & Relationships on the left, then select New.
Choose the “Formula” option and then click on “Next”. Select the desired return type and click on Next.
- Define the formula using fields, functions, operators and constants. Hence, it provides a user-friendly interface to build formulas according to the requirement.
Can we track the formula fields in Salesforce using field history tracking?
As per the standard functionality, Formula fields cannot have Field History Tracking set up. However, you can create a custom field and ensure that it updates with a flow to retain the same values as the Formula field to track it.
This workaround can help you achieve the desired results.
How do Formula fields and Rollup summary fields in Salesforce differ from each other?
Formula fields calculate and manipulate data within a single record, based on information from the same record. Roll-up summary fields aggregate data from child records to display summarized details on the parent record.
Can we use the formula field in SOQL Query?
Since formula fields are calculated at run time and not stored as separate fields in the database, we can’t use them directly. Using the API name of a formula field in your SOQL query will allow you to use the results of the formula field.
For example, Total_Amount__c is a Custom Formula field on the Opportunity object. Then to Query the Total_Amount__c the Query can be written as below:
‘SELECT Id, Name, Total_Amount__c FROM Opportunity WHERE Total_Amount__c > 10000’
The Better Salesforce Formula Editor brings a host of valuable features and enhancements to streamline the formula creation process within Salesforce.
With features like auto-complete functions, real-time syntax checking, diff mode for comparisons, syntax highlighting, improved indentation, and convenient function placeholders, this editor significantly enhances the efficiency and accuracy of creating formulas.