The Formula field
Formula fields in Salesforce are a special type of read-only fields that evaluate the specific equation at runtime and generate values accordingly. These fields are generally used where the data is entered by the user in a field and that data needs some logical processing and storage in another field. We need to define a formula expression/equation that will be executed while a record is being saved.
Let's start with an example. The event company Appiuss wants to calculate the age of the participants while they are registering for an event, depending on the date of birth the registrant entered at the time of registration. Additionally, they want to show it as a read-only field.
In order to fulfill this requirement, you can follow these steps:
Navigate to Setup | Build | Create | Objects.
Click on the label of the object; in our case, click on Event Registration.
Under the Custom fields and relationships section, click on the New button. It will redirect you to a new window from...