Lookup relationship is a child to parent relationship that allows us to relate one object to the another object. The object on which the relationship is created considered as child object, and the object at which the relationship points is considered as parent object. We can create maximum 40 lookups for any Salesforce object. This relationship is a one to many relationship. That means a parent record is related to multiple child records but a child record is related to only one parent record. If you delete a parent record, then it will not impact on any of its child record.
For more details, let’s take an example of two standard Salesforce objects “Account” and “Contact”. You can create a lookup relationship between these two objects so that each Contact record is related to a specific Account record. Using this relationship, you can easily watch out which Accounts are related to which Contacts and vice-versa.
To Create a Lookup Relationship in Salesforce, follow these steps:
Step-1: In the “Object Manager“, you must navigate to the object you want to create the lookup field. This will be the child object in this relationship.
Step-2: Select the “Fields & Relationships” tab from the left sidebar on the object’s setup page.
Step-3: Click on the “New” button to create the lookup field.
Step-4: Select “Lookup Relationship” as a data type.
Step-5: Then, select the related object from the “Related To” dropdown menu. This object will be the parent in the relationship.
Step-6: Then, enter the field label and field name for the lookup field.
Step-7: Further, select the profiles to which you want to grant edit access via field-level security.
Step-8: Select the “Page Layout” that should include the field. Also, select the “Page Layout” that should include it as a related list.
Step-9: Lastly, click “Save” to finish the lookup creation.
You can also create a lookup relationship using the Salesforce API as well as the Salesforce CLI. For more information on creating lookup relationships using these tools, we prefer you the Salesforce documentation.
Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to Salesforce. You can also visit the salesforce development page to check the services we offer.