How to Create Lookup Relationship Field Type in Salesforce

In this Salesforce tutorial, we will discuss how to create the lookup relationship field type in Salesforce. The lookup relationship is the most simple relationship we can create between two objects in which there are no complications associated.

I am the Hr manager of the company that wants to hire an experienced guy who has knowledge about the salesforce. After hiring that guy they give a duty where they needed to create a lookup relationship which simply joins the two objects together, the one object using the associated elements on the other object.

After taking two many interviews for hiring an employee finally, we hire an employee who is experienced in Salesforce and can easily create and join two objects together by simply using the lookup relationship field. So after looking at multiple solutions, they found one solution that helps him for solving that issue.

Let’s go into more detail about creating the lookup relationship field type in Salesforce Lightning and Salesforce Classic.

Lookup relationship field type in Salesforce

The lookup relationship field type in Salesforce is defined as a field that can create a relationship that connects one object to another object.

The relationship fields allow the users to select the value from a popup list by clicking on the lookup icon. The other object is the source of value in the list.

For example, there are two objects one is the parent object, and another is a child object. If we can delete the record of the one-side object records. The records associated with it are on the many side or we can say that the child object will not get deleted.

And it is also not required for every many side object record to be associated with the one side object record this relationship is lookup.

For example, we have a student who is not related to any of the branches, or we can say that which is not associated with any of the branches, which is possible in a lookup relationship where, as it is not possible in any other relationship.

There is no implication or there is no possibility that the many-side relationship is controlled by the one-side object in a lookup relationship. No security and sharing settings, and no ownership. They both have their own ownership and no security and sharing settings are associated or derived from the one side object to the many side object.

Now, let’s move further and see how to create the lookup relationship field type in Salesforce Lightning and Salesforce Classic.

Read How to Create Formula Field Type in Salesforce

How to create a lookup relationship field type in Salesforce Lightning

Here we are creating a lookup relationship field type in Salesforce Lightning. Here we take an example There is a student who has lots of books, and these books help in their studies. From these books, they crack their exams and increase their knowledge, which can help them apply for jobs in the future.

To make a relationship between the books and students, there is a field that we can use as a lookup relationship. This relationship enables one to many connections between the student and the books object. Here Student work as a parent and the book works as a child object. This lookup relationship is present under the Field and Relationships.

If you want to learn how to create a lookup relationship field type in salesforce lightning, follow these steps:

Step-1: Here we are login into our Salesforce account, now, move to the gear icon. Click on the gear icon, and under this gear icon there are two options. The first one is Setup, and another one is Service Setup.

Click on the Setup option. After clicking on the setup option, the Setup page is open. Here we can see the object manager option at the nav bar. Click on the object manager option.

How to create a lookup relationship field type in Salesforce

Step-2: The object manager page is open after clicking on the object manager option. Here we can see lots of objects are present. Here we want to select the book object; for this, we enter the book object in the search box, and the book object comes at the top. Click on the book object.

How to create a lookup relationship field type in Salesforce Lightning

Step-3: After clicking on the book object, the book page is open. Here we can see the details on the left side of the page. Under this details section there is lots of detail is present.

Here we want to select the field and relationship option. Click on the fields and relationship option.

Create a lookup relationship field type in Salesforce

Step-4: The field and relationship page is open after clicking on the field and relationship. Here we can see that many fields are present, and now we want to create one more field under this book field and relationship.

For creating a new field and relationship. Here is the new button, by simply clicking on the new button our new field is created. So click on the new button.

Create a lookup relationship field type in Salesforce Lightning

Step-5: The new custom field page is open after clicking on the new button. Here we can see that many data types are present, which can specify the information the custom field will contain. Here we are selecting the lookup relationship field. Click on the next button.

Salesforce create a lookup relationship field type

Step-6: The book new relationship page opens after selecting the lookup relationship field. Now choose the related option and select the other object to which this object is related. Here we are selecting the USA Student object, which is work as a lookup relationship and then click on the next button.

Salesforce Lightning create a lookup relationship field type

Step-7: After clicking the next button, enter the label and name for the lookup field. First, fill the field label as USA Student and then fill the field Name. The field name is automatically fielded by simply clicking on the field.

Click on the next button at the top and the bottom of the new relationship page.

How to create lookup relationship field type in Salesforce

Step-8: After clicking the next button, we move to our next step, establishing field-level security for the reference field.

Select the profiles we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security. Click on the visible checkbox of the field-level security for the profile and then click on the next button, which is present near the previous option.

How to create lookup relationship field type in Salesforce Lightning

Step-9: After clicking the next button, we can now add the reference field to the page layout. Select the page layouts that should include this field. The field will be added as the last field in the field two-column section of these page layouts.

This field will not appear on any pages if you do not select a layout. To change the location of this field on the page, we will need to customize the page layout. Click on the next button.

Create lookup relationship field type in Salesforce

Step-10: We can add the custom field to the page layout after establishing the field security. Select the title that the related list will have in all of the layouts associated with the parent and the related list label as books.

Select the page layout that should include this field. This field will be added as the last field in the first two-column section of this page layout. The field will not appear on any pages if we do not select a layout. To change the location of the field on the page. Click on the save button.

create lookup relationship field type in Salesforce lightning

Step-11: After clicking the save button, the USA Student Lookup field is created successfully and present under the field and relationships.

Salesforce create lookup relationship field type

Step-12: After creating the USA Student field now, click on the app launcher, and under this app launcher, there is a sales option. Click on the Sales; the Sales page is open.

And under this Sales page, there is a Books object that is present on the nav bar. Click on the books object, and under this books object, there is a detail option, and under this detail option, there is the USA Student field. Fill the USA Student field as Arne Nitzsche.

Salesforce Lightning create lookup relationship field type

Step-13: After filling the book’s detail, now open the Student object that is also present on the nav bar. Click on the USA Student object. After clicking on the USA Student object, the USA Student page is open. Here we can see that the 1002 book is related to Arne Nitzsche USA students with the help of lookup relationships.

How to create the lookup relationship field type in Salesforce Lightning

This way, we understand how to create the lookup relationship type in Salesforce Lightning. Let’s Proceed and learn how to create the lookup relationship field type in Salesforce Classic.

Read How to Use Lookup Field with Filter in Salesforce

How to create a lookup relationship field type in Salesforce Classic

Here we are creating the lookup relationship field type in Salesforce Classic. Here we take an example there is a school with lots of students, and all the students studying in that school take the exam after studying. After giving the exam, they get good marks and become successful people.

Now we create the lookup relationship between the school and the students by simply using the Lookup relationship field.

If you want to learn how to create the lookup relationship field type in Salesforce Classic, follow these steps:

1: Now login into the Salesforce account, when we log in the Salesforce lightning account is open for moving to the Salesforce Classic. Click on the Profile picture, and under this profile picture, there is an option to switch to salesforce classic. Click on the switch to the Salesforce classic option.

After clicking on the switch to the Salesforce Classic option, we are moving to the Salesforce Classic version. Here we click on the username drop-down arrow, and the drop-down list is open under this drop-down arrow. Under this List, there is a setup option here, we are clicking on the setup option.

How to create a lookup relationship field type in Salesforce Classic

2: The setup page is open after clicking on the setup option. Under this setup page, there is App Setup, and under this App Setup, there is create option. Click on the drop-down arrow of the Create option. After clicking on the Create drop-down arrow, the drop-down list is open.

Under this create drop-down list there is an objects option. Click on the objects option.

Create a lookup relationship field type in Salesforce Classic

3: After clicking on the objects, the objects page is open and there are lots of custom objects present. Here we want to select the USA Student object by simply clicking on the USA Student object.

Salesforce Classic create a lookup relationship field type

4: After clicking on the USA student object, the USA Student custom object page is open. Now scroll to the bottom of the page and see the custom field and relationships section here.

And we want to create a new custom field related to USA students by simply clicking on the new button.

How to create lookup relationship field type in Salesforce Classic

5: The new custom field page is open after clicking the new button. Here we can choose the field type by specifying the type of information that the custom field will contain. Here we are selecting the lookup relationship field. Click on the next button.

Create lookup relationship field type in Salesforce Classic

6: After clicking on the lookup relationship field type. The USA Student Relationship page is open.

Here we can choose the related object, by simply selecting the other object to which this object is related. Here we select the School related to the object and click the next button.

Salesforce Classic create lookup relationship field type

7: After clicking on the next option, now enter the label and name for the lookup field. First, fill the field label, here, we are filling the field label as School and then fill the field name by simply clicking on the field, and the field is filled automatically. After filling in all the labels and names of the fields, simply click on the next button.

How to create the lookup relationship field type in Salesforce Classic

8: After filling in the complete information, now establish the field-level security for the reference field. Select the profiles we want to grant edit access to this field via field-level security.

The field will be hidden from all profiles if we do not add to it field-level security. Select the visible checkbox of the field-level security for the profile after that click on the next button, which is present near the previous option.

create the lookup relationship field type in Salesforce Classic

9: Now established the field-level security for a reference field, now we can add the reference field to the page layout. Select the page layouts that should include this field.

The field will be added as the last field in the field two-column section of these page layouts. This field will not appear on any pages if you do not select a layout.

To change the location of this field on the page, we will need to customize the page layout. Click on the next button.

Salesforce Classic create the lookup relationship field type

10: After adding the reference field to the page layout, we can add the custom field to the page layout after establishing the field security.

Select the title that the related list will have in all of the layouts associated with the parent and the related list label as books.

Select the page layout that should include this field. This field will be added as the last field in the first two-column section of this page layout.

The field will not appear on any pages if we do not select a layout. To change the location of the field on the page. Click on the save button.

How to create an lookup relationship field type in Salesforce Classic

11: After clicking on the save button, mow again, click on the objects, and click on the USA Student object.

Under this USA Student object, there are custom fields and a relationship section and under this section, we can see that the school lookup field is created successfully.

Create an lookup relationship field type in Salesforce Classic

So, with this, we have learned how to create the lookup relationship field type in Salesforce Classic.

Conclusion

In Salesforce, a lookup relationship can be used to join two objects together like we may look up one object using the connected elements on another object. It is a loosely connected relationship that allows one to many connections between two objects.

You learned how to create the lookup relationship field type in Salesforce. And I have also explained all the steps of lookup relationship field type in Salesforce Lightning and Salesforce Classic.

You may also like: