{"id":4498,"date":"2021-06-18T04:02:55","date_gmt":"2021-06-18T04:02:55","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=4498"},"modified":"2021-06-18T05:14:36","modified_gmt":"2021-06-18T05:14:36","slug":"difference-between-master-detail-and-lookup-relationships","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/","title":{"rendered":"Difference between Master-detail and Lookup relationships"},"content":{"rendered":"<h2>Master-Detail Relationship:<\/h2>\n<ul>\n<li>It is a tightly coupled record that has a direct dependency between the two objects. It can also be described as a parent-child relationship.<\/li>\n<li>The record of detail cannot be created without a master.<\/li>\n<li>The sharing rules are inherited from the master to the detail record.<\/li>\n<li>We cannot update the relationship to the master in a master-detail relationship.<\/li>\n<li>The number of master-detail relationships that can be used is limited to 2.<\/li>\n<li>Master-detail relationships are automatically included in report record types.<\/li>\n<li>We also cannot set the profile object permissions for the record of detail.<\/li>\n<li>If a master record is deleted then the record of its detail also gets deleted along with it, that is, it implements cascade delete.<br \/>\nRoll-Up Summary can be created on a master detail.<\/li>\n<\/ul>\n<h3>Lookup Relationship:<\/h3>\n<ul>\n<li>This type of relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.<\/li>\n<li>This is a loosely coupled relationship.<\/li>\n<li>These are used to reference commonly shared data, such as reference data.<\/li>\n<li>The maximum number of lookup relationships in a field can be 40.<\/li>\n<li>They are used to link two objects together when we do not want to have the behavior of the master-detail like sharing rules, profile permissions, and cascade delete.<\/li>\n<li>Lookups are used when we need to relate multiple &#8216;parents&#8217; to the record of detail.<\/li>\n<li>Deletion of the parent just deletes the related field in the child but not the whole record.<\/li>\n<li>This type of relationship is also like a one-to-many relationship.<\/li>\n<\/ul>\n<p>We also have another type of relationship, <strong>External Lookup Relationship<\/strong> which creates a relationship to link a Salesforce object to another external object. This external object is any object whose data is stored outside the Salesforce org. This also behaves similarly to Lookup Relationships.<\/p>\n<p><strong>For example,<\/strong><br \/>\nIn a delivery service company, a delivery schedule needs to be always linked to a delivery location. If we remove a delivery location from our list, then all the related delivery schedules should also be deleted automatically. This kind of dependency can be achieved through a Master-detail relationship between the delivery location and delivery schedule <a href=\"https:\/\/studysection.com\/blog\/salesforce-pardot-introduction-and-its-uses\/\">Salesforce<\/a> objects.<\/p>\n<p>If we take the above scenario only, then a delivery agent can have multiple deliveries to complete. So a single agent can be linked to multiple deliveries, and the deliveries can look up to the same agent.<\/p>\n<p>The Salesforce lookup relationship has no relation with other records. It does not depend on any other objects, whereas a master-detail relationship has an association with other records.<\/p>\n<p>On the other hand, the lookup relationship is just a reference. It can be even blank or NULL. In the database, we can pull the data from particular fields based on the reference keys easily.<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/06\/lookup.png\" alt=\"lookup\"\/><\/p>\n<p><small><em>jQuery presents a tree-like structure of all the elements on a webpage simplifying the syntax and further manipulating such elements. The <a href=\"https:\/\/www.studysection.com\/jquery-3.x-advanced\">jQuery Certification Exam<\/a> by StudySection will secure your fundamental knowledge and a basic understanding of jQuery as an asset to improve your skills.<\/em><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Master-Detail Relationship: It is a tightly coupled record that has a direct dependency between the two objects. It can also<\/p>\n","protected":false},"author":1,"featured_media":4501,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[668,669],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Difference between Master-detail and Lookup relationships - SS blog<\/title>\n<meta name=\"description\" content=\"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Difference between Master-detail and Lookup relationships - SS blog\" \/>\n<meta property=\"og:description\" content=\"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-18T04:02:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-18T05:14:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/06\/relationship.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Difference between Master-detail and Lookup relationships\",\"datePublished\":\"2021-06-18T04:02:55+00:00\",\"dateModified\":\"2021-06-18T05:14:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\"},\"wordCount\":507,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"LookupRelationships\",\"Master-detailRelationships\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\",\"url\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\",\"name\":\"Difference between Master-detail and Lookup relationships - SS blog\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2021-06-18T04:02:55+00:00\",\"dateModified\":\"2021-06-18T05:14:36+00:00\",\"description\":\"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Difference between Master-detail and Lookup relationships\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Difference between Master-detail and Lookup relationships - SS blog","description":"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/","og_locale":"en_US","og_type":"article","og_title":"Difference between Master-detail and Lookup relationships - SS blog","og_description":"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.","og_url":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2021-06-18T04:02:55+00:00","article_modified_time":"2021-06-18T05:14:36+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/06\/relationship.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Difference between Master-detail and Lookup relationships","datePublished":"2021-06-18T04:02:55+00:00","dateModified":"2021-06-18T05:14:36+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/"},"wordCount":507,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["LookupRelationships","Master-detailRelationships"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/","url":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/","name":"Difference between Master-detail and Lookup relationships - SS blog","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2021-06-18T04:02:55+00:00","dateModified":"2021-06-18T05:14:36+00:00","description":"Lookup relationship can be used when we just need to have the relationship between two objects but not a direct dependency on each other.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/difference-between-master-detail-and-lookup-relationships\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Difference between Master-detail and Lookup relationships"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":47036,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4498"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=4498"}],"version-history":[{"count":3,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4498\/revisions"}],"predecessor-version":[{"id":4503,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4498\/revisions\/4503"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/4501"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=4498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=4498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=4498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}