Lookup Relationship in Salesforce

Lookup Relationship in Salesforce - Here's All You Need to Know

Introduction

Lookup Relationship is an object type relationship in Salesforce. It is one to one or one to many relationships between two objects.

Some Features of Lookup Relationship:

  • It creates a Loosely Coupled relationship between parent and child objects.
  • In lookup relationships, there is no need to select parent object records in the child object record.
  • There is no cascade record deletion between parent and child objects. This means if you delete parent records then your child record cannot be deleted.
  • The lookup field is not required on the page layout of child objects.
  • You cannot create a rollup summary field on the parent object record when two objects relate to each other in a lookup relationship.
  • It is not necessary to select a parent object record while creating a child object record.
  • This relationship can happen between two standard objects or two custom objects or standard-custom objects.
  • Both Parent and Child Objects have their own Security Control and Sharing Setting.
  • By default record ownership of child, records are not controlled by the parent object.

How to Create a Lookup Relationship Field

Step - 1: Go to set up.

Step - 2: Click on the ‘Object Manager’.

Step - 3: Select your child object. Here I select ‘Institute’ Object as child object.

Step - 4: Now click on ‘Fields and Relationships’.

Step - 5: Click on the ‘New’ button to create a Lookup relationship field on Institute Object.

Step - 6: Select Lookup relationship data type and click on the ‘Next’ button.

dont miss out iconDon't forget to check out: Types of Relationships in Salesforce - All You Need to Know

Step - 7: Here you have to select your parent object from the drop-down menu in the ‘Related to’ field. Here I select the ‘Student’ object as the parent object. You can select any standard or custom object as the parent object.

Step - 8: Click on the ‘Next’ button.

Step - 9: Fill in the details for the Lookup relationship:

  1. Field Label: Here you have to write the name of your lookup relationship field. Generally, we use the parent object name as a lookup relationship field on the child object. Here I use the parent object name ‘Student’ as a field label.
  2. Field Name: It automatically catches the field label name.
  3. Description: You can write a description of your field.
  4. Help Text: You can write about your field information here.
  5. Child Relationship Name: Hereby default your child object name is assigned by salesforce. Here 'Institutes’ is already present in plural form.
  6. Required: By checking this checkbox you can make this field required on the object.
  7. What to do if the lookup record is deleted? : Here you can choose any one option from the given.
  8. Auto-add to custom report type: It will be available for the custom report type and it is by default checked.

Step - 10: Now click on the ‘Next’ button.

Step - 11: Here you can select the visibility of this field for different profiles. Here I select visible to all. You can also manage field-level security here by allowing some profiles of this field as ‘Read Only’ and clicking on the ‘Next’.

Step - 12: Now you can manage this field assignment to the page layout of the Institute object i.e on your child object. Here is by default assign this field to the page layout of the institute object. And then click on ‘Next’.

dont miss out iconCheck out another amazing blog by Rajat here: How to Add Your Visualforce Page in your Application as a Tab | Salesforce Guide

Step - 13: Now you have to add these institute records on a related list of your parent record i.e. student’s records. This checkbox is by default checked.

Step - 14: Now click on the ‘Save’ button.

Hence your Lookup Relationship is created successfully and it will be available on ‘Fields and Relationships’ of your Institute object.

Also, Institute object’s records will be available on student’s objects records related list.

I hope this information will be helpful for you.

Thank you!!!

Responses

Popular Salesforce Blogs