How to Create Cross-Object Formula fields in Salesforce

In the Salesforce tutorial, I will explain how to create cross-object formula fields in Salesforce. This can be created on both Salesforce Lightning and Salesforce Classic editions.

Humana is a Louisville-based company and it has two objects and both of these objects are related to each other. The first object has one side of the relationship and the second object has many sides of the relationship.

We create cross-object formula fields whenever we want. The first object record fields are to be visible on the object’s second record.

So, here we will discuss these topics in this Salesforce tutorial:

  • What are the cross-object formula fields in Salesforce
  • How to create the cross-object formula fields in Salesforce
  • How to create the cross-object formula fields in Salesforce lightning
  • How to create the cross-object formula fields in Salesforce Classic

What are the cross-object formula fields in Salesforce

The Salesforce cross-formula field is a formula that reaches two related objects and an instance of merge fields on those objects.

A cross-object formula can be recommended to merge the field from the parent object if the object is on the particular side of the master-detail relationship. It can also work with the lookup relationships.

So, with this, we have learned What are the cross-object formula fields in Salesforce are, and further, we will discuss how to create the cross-object formula field in Salesforce.

Read: How to a Create Custom Field in Salesforce

How to create the cross-object formula fields in Salesforce

Here we will discuss the tips for creating or building cross-formula fields in Salesforce.

  • For every object in cross object formula salesforce permits the highest of ten unique relationships.
  • In the roll-up summary field, we can not recommend the cross-object formulas.
  • In the cross-object formula can be recommended to merge the field from the parent object if the object is on the particular side of the master-detail relationship.
  • We can not recommend fields from accounts through personal accounts in the cross-object formula.
  • It recommended the currency field that turns the value into the currency of the record that can hold the formula.
  • The first object has one side of the relationship and the second object has many sides of the relationship.
  • We build the cross-object formula fields whenever we want. The first object record fields are to be visible on the object’s second record.

Now, let’s move ahead and see how to create the cross-object formula in Salesforce. We will explore both the salesforce experiences: Salesforce lightning and Salesforce Classic.

How to create the cross-object formula fields in Salesforce lightning

Here we are creating the cross-object formula field on the contact object which will refer to the website field on the account object.

If you want to learn how to create the cross-object formula fields in Salesforce lightning follow these steps:

Step-1: Firstly click on the App Launcher then enter the sales in the search box and click on the sales.

How to create the cross object formula fields in salesforce
How to create the cross-object formula fields in salesforce

Step-2: After clicking on the sales, the sales home page is open. Here click on the accounts object.

How to create the cross object formula fields in salesforce lightning
Click on the sales

Step-3: After clicking on the account object scroll to the bottom and you can see the contacts under the account. The two contacts are present one is Linwood Dibbert and the second is Jack Rogers.

Create cross object formula fields in Salesforce
Contact under the account

Step-4: After clicking on one of the contacts you can see that there is no field of account website. Now apply the cross-object formula field on the contact object which will refer to the website field on the account object and after applying the cross-object formula the website field is shown in the contact details.

Create cross object formula fields in salesforce lightning
Contact details

Step-5: Go to the setup, click on the object manager after that enter the contact in the search box, and then click on the contact objects.

Cross object formula fields in salesforce
Select the contact object

Step-6: After selecting the object the contact page is open then click on the field and relationship that is present in the left sidebar.

Cross object formula field in salesforce lightning
Click on the field and relationship

Step-7: After clicking on the field and relationship option, the field and relationship page is open then click on the new button.

Cross object formula field and relationship in salesforce
Click on a new option

Step-8: After clicking on the new option choose the field data type. Here we are selecting the formula field data type and then click on the next option.

Cross object choose the formula fields in salesforce
Choose the field type

Step-9: After choosing the formula data type, choose the output type. First field the label and then the field name is automatically fielded after that choose the formula return type. Here we are selecting the text formula return field.

Cross object formula field in salesforce choose the formula type
Select the text field

Step-10: After choosing the text field, insert the formula by clicking on the insert field option then select the account then select the website and click on the insert option.

Salesforce create cross object formula fields in salesforce
Insert the formula

Step-11: After clicking on the insert option you can see that our formula is inserted now check whether the formula is correct or not.

Cross object formula fields is inserted
Cross-object formula fields are inserted

Step-12: After inserting the field now click on the check syntax option this will show us whether our inserted formula is correct or not. then check the treat blank fields as a blank option after that click on the next option.

Salesforce lightning cross object formula fields in salesforce
Click on the next option

Step-13: After clicking next check the field level security and set it according to you then click on the next option and then add to page layouts after that click on the save option.

Salesforce lightning create cross object formula fields in salesforce
Click on the save option

Step-14: After clicking on the save option, again go to the account object click on it then select the Burlington textile corp of America record. Under the record, there is a contacts section inside this section two contacts are present. Click on one of the contacts.

Salesforce create cross object formula fields in salesforce lightning
Select the contact

Step-15: Here we are clicking on the Lindwood Dibbert contact under this contact we can see that the account website is present. Our cross-object formula field is created.

Salesforce lightning create cross object formula fields in the salesforce
Cross object formula field is created

So, with this, we have learned how to create the cross-object formula fields in salesforce lightning.

How to create the cross-object formula fields in Salesforce Classic

Here we are creating the cross-object formula field on the contact object which will refer to the account number field on the account object.

If you want to learn how to create the cross-object formula fields in Salesforce classic follow these steps:

Step-1: Firstly, click on the setup and then click on the accounts object that is present in the nav bar, and after that click on the Burlington Textiles Corp of America record.

How to create the cross object formula fields in salesforce classic
How to create the cross-object formula fields in salesforce classic

Step-2: After clicking on the account object record scroll to the bottom and you can see the contacts under the account record. The two contacts are present one is Linwood Dibbert and the second is Jack Rogers.

Salesforce classic cross object formula fields
Salesforce classic cross object formula fields

Step-3: After clicking on one of the contacts you can see that there is no field as the account number. Now apply the cross-object formula field on the contact object which will refer to the account number field on the account object after applying the cross-object formula the account number field is shown in the contact details.

How to create cross object formula field in salesforce classic
Account number field is not present

Step-4: Again go to setup, and enter the contacts object in the Quick Find Box you can see that the contact object is present under the customize app click on the drop-down arrow of the contact object and then click on the fields that are present under the contact object.

Cross object formula fields in salesforce classic
Click on the fields

Step-5: After clicking on the field, the contact custom fields page is open scroll to the bottom of the page and you can see the contact custom fields and relationships label beside this label, there is a new option click on the new button.

Cross object formula fields in the salesforce classic
Click on the new option

Step-6: After clicking on the new option choose the field data type. Here we are selecting the formula field data type and then click on the next option.

Cross object formula fields in the salesforce
Cross-object formula fields in the salesforce

Step-7: After choosing the formula data type, choose the output type. First field the label and then the field name is automatically fielded after that choose the formula return type. Here we are selecting the text formula return field.

cross object formula return type field in salesforce
Choose the text field

Step-8: After choosing the text field, insert the formula by clicking on the insert field option then select the account then select the account number and click on the insert option.

Cross object formula field is inserted in salesforce
cross object formula field is inserted in the salesforce

Step-9: After inserting the field now click on the check syntax option this will show us whether our inserted formula is correct or not. then check the treat blank fields as a blank option after that click on the next option.

Cross formula fields blank field handling
Cross formula fields blank field handling

Step-10: After clicking next check the field level security and set it according to you then click on the next option and then add to page layouts after that click on the save option.

cross object formula fields is saved
cross object formula fields are saved

Step-11: After clicking on the save option, again go to the account object click on it then select the Burlington textile corp of America record. Under the record, there is a contacts section inside this section two contacts are present. Click on one of the contacts.

Here we are clicking on the Lindwood Dibbert contact under this contact we can see that the account website is present. Our cross-object formula field is created.

Cross object formula fields is created
Cross-object formula fields are created

This is how we can understand how to create the cross-object formula fields in salesforce classic.

Also, check : How to Create a Junction Object in Salesforce

Conclusion

In this Salesforce tutorial, we have learned how to create the cross-object formula fields in salesforce. This can be performed on both salesforce lightning and salesforce classic.

  • What are the cross-object formula fields in Salesforce
  • How to create the cross-object formula fields in Salesforce
  • How to create the cross-object formula fields in Salesforce lightning
  • How to create the cross-object formula fields in Salesforce Classic

You may also like to read the following Salesforce tutorials.