How to Create External Lookup Relationship Field Type in Salesforce

In this Salesforce tutorial, we will learn how to create the external lookup relationship field type in Salesforce. We can use this external lookup relationship for creating a relationship that links the object to an external object.

I am in the Salesforce company that is placed in the USA. While working here, I got a duty where I needed to create an external lookup relationship for creating a relationship that links the object to the external object whose data is stored outside the salesforce org. I use the external lookup relationship field Type that is present under the Field and Relationships to fulfill this requirement.

As we go through so many solutions, I got this solution where I discovered the external lookup relationship field that permits the user to create an external lookup relationship for creating a relationship that links the object to the external object. Moreover, we will focus on some of the practical scenarios for implementation.

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

External lookup relationship Field Type in Salesforce

An External lookup relationship field type is the field that is used for creating the relationship that links the object to the external object whose data is stored outside Salesforce.

For example, there is a person who orders some food and after ordering the food the person gets the order id. The restaurant manager can link the order detail of the customer to the order based on the order ID. When the food is ready they simply click on the order id and the details of the order is comes up they checked whether the order is for this customer or not.

The order is related to this order id customer, so they ask her delivery agent to deliver this parcel to their customer. For all this process the hotel manager uses the External lookup relationship that can easily link the object to the external object. This External Lookup relationship field is present under the Field and Relationships.

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

Read How to Create Formula Field Type in Salesforce

How to create an external lookup relationship field type in Salesforce Lightning

Here we are creating the external lookup relationship field type in Salesforce Lightning. There is a top restaurant in the USA from where people order the food and after ordering the food the person gets the order id.

The restaurant manager can link the order detail of the customer to the order based on the order ID. When the food is ready they simply click on the order id and the details of the order is comes up they checked whether the order is for this customer or not.

The order is related to this order id customer, so they ask her delivery agent to deliver this parcel to their customer. For all this process the hotel manager uses the External lookup relationship that can easily link the object to the external object.

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

Step-1: Here we are login to the Salesforce lightning account, Go to the gear icon. After clicking this gear icon, the two options are shown first one is Setup, and another one is Service Setup. Here we are clicking on the Setup option.

Clicking on the setup option, the setup page is open. On this setup page, there is an object manager option present on the nav bar. Click on the Object Manager.

How to create an external lookup relationship field type in Salesforce

Step-2: After clicking on the Object Manager, the object manager page is open. Here we can see lots of objects are present. And here we want to select the order object.

For selecting the order object, search the order object in the search box by simply typing the orders. The order object comes at the top. click on the order object.

How to create an external lookup relationship field type in Salesforce Lightning

Step-3: After selecting the order object, the order object 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 an external lookup relationship field type in Salesforce

Step-4: The field and relationships page is open after selecting the field and relationship option. Here we are clicking on the new button that is present under the field and relationship for creating the new field type.

Create an external lookup relationship field type in Salesforce Lightning

Step-5: The data type page is opened by clicking the new button. We can see that lots of data types are present on this page. And here we select the order type field from the page. Click on the next button.

Salesforce create an external lookup relationship field type

Step-6: The order’s new custom field page is open after clicking the next button. Now choose the related external object. Select the external object to which this object is related, now we are selecting the related to as Order Detail. After that, click on the next button at the top and the bottom of the page.

Salesforce Lightning create an external lookup relationship field type

Step-7: After selecting the related to object. Now enter the details, fill the field label as Order ID, and then enter the length as 18. After that, fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise, leave the field the same. After that, click on the next button at the top and the bottom of the page.

How to create external lookup relationship field type in Salesforce

Step-8: Now established the field-level security, after entering the details. 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 and then click on the next button that is present at the top and the bottom of the established field-level security page.

How to create external lookup relationship field type in Salesforce Lightning

Step-9: After clicking on the next button, now add the reference field to the page layout, now the page layouts that should involve this field. The field will be added at the last field and the field will not appear on any pages.

Create external lookup relationship field type in Salesforce

Step-10: Add the custom field to the page layout after establishing the field securitySelect the page layout that should include this field.

This field will be added as the last field in the first 2-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 external lookup relationship field type in Salesforce Lightning

Step-10: After Clicking on the save button, Again click on the order object that is present at the nav bar, and the order object page is open. Click on the field and relationship. The field and relationship page is open and under this page.

The order id is created successfully. And this order id field is created under the field and relationships section.

Salesforce create external lookup relationship field type

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

How to create an external lookup relationship field type in Salesforce Classic

Here we are creating the external lookup relationship field type in Salesforce Classic. Let’s take an example. We are using the Product object inside the product object, we are creating the product selling detail for getting the details of the selling product.

And we want to get the detail of the product for this product manager can create the external lookup relationship field linked up to the product object.

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

Step-1: When we log in to Salesforce, the Salesforce lightning edition is open. To switch to Salesforce Classic, click on the Profile picture. The drop-down menu of the profile picture list is open. Under this profile picture list, there is an option to switch to Salesforce Classic. Click on it. After clicking on the switch to the Salesforce Classic option.

Click on the drop-down arrow of the username. The drop-down list is open, under this list Setup option is present below the My Profile option. Click on the Setup.

How to create an external lookup relationship field type in Salesforce Classic

Step-2: After clicking on the setup option, the setup page is open. Under this setup page, the product object is present on the left sidebar. Click on the product drop-down arrow. The product drop-down list is open. Under this drop-down list, we select the fields option for creating the fields.

Create an external lookup relationship field type in Salesforce Classic

Step-3: The product custom field page is open after selecting the fields option. Scroll to the bottom of the page, there is a product custom field and a relationship section. For creating the new field click on the new button.

Salesforce Classic create an external lookup relationship field type

Step-4: After clicking on the new button, the data type page is opened. We can see that lots of data types are present on this page. We select the product type field from the page from all these data types. Click on the next button.

How to create external lookup relationship field type in Salesforce Classic

Step-5: The product’s new relationship page is open after clicking the next button. Now choose the related external object. Select the external object to which this object is related, now we are selecting the related to as Order Detail. After that, click on the next button at the top and the bottom of the page.

Create external lookup relationship field type in Salesforce Classic

Step-6: After selecting the related to object. Now enter the labels and names for the lookup field, first, fill the field label as Product Selling Detail, after that enter the length as 18.

After that, fill the field name by simply clicking on the field, and the field name is automatically filled, then fill the description if you want to fill otherwise, leave the field the same. After that, click on the next button at the top and the bottom of the page.

Salesforce Classic create external lookup relationship field type

Step-7: Here, we have established the field-level security. 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. After that, click on the next button.

How to create the external lookup relationship field type in Salesforce Classic

Step-8: Here we are adding the reference field to the page layout after clicking on the next button, now the page layouts that should involve this field. The field will be added at the last field, and the field will not appear on any pages.

Create the external lookup relationship field type in Salesforce Classic

Step-9: Here we are adding the custom field to the page layout after establishing the field securitySelect 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.

Salesforce Classic create the external lookup relationship field type in Salesforce Classic

Step-10: Now we want to see the created field, for this again click on the product object, and under this product object field option is present, select the field. After selecting the field the product field and relationship page are open.

Under this page, we can see that lots of fields are created and here we can see our Product selling detail field.

How to create a external lookup relationship field type in Salesforce Classic

This is how we learned how to create the external lookup relationship in Salesforce Classic.

Conclusion

In Salesforce, this external lookup relationship field type is the field that works as creating the relationship between two objects and it also links this object to the external object whose data is stored outside Salesforce.

I think you learn how to create an external lookup relationship field type in Salesforce. Also, I have explained step by step how to create the external lookup relationship field type in Salesforce Lightning and in Salesforce Classic.

You may like to read: