Salesforce - Using Formula Fields


Many times we need to manipulate the values of the fields stored in the Salesforce object by applying a few conditions or calculations. For example, we need to get the Account number value linked to the contact object, so that we can find the Account number from the contact name. In such scenarios, we create formula field in addition to the existing fields in the object.

Let us now see the steps to create formula field.

Step 1

Go to the link path Setup Home → Object Manager → Contact. Then scroll down to the Fields and Relations tab and add New. Choose Formula as the data type and click Next. The following window appears. Here we choose the return type as Text and also fill in the Field Name and Field Label.

Formula Field 3

Step 2

Clicking on Next brings takes you to the next window wherein, you have to select the field based on which the formula will be built. Let us now choose Account number from the Account table. Click Insert to insert this field into the Contact object.

Formula Field 4

Step 3

In this step, we can see the field Account Number appear under the fields of the Contact object as shown below.

Formula Field 5