Lookup relationships

The lookup field is similar to the master–detail relation, as it is used to link two objects without having the same strong binding between the parent and child records.

This means that sharing is not inherited, you cannot have roll-up fields, the child record has its own owner, and if you delete the parent record, then the child is not automatically deleted, and you can look up the same object type.

Creating a lookup field is quite similar to creating the master–detail type:

Lookup field configuration

The only difference is that you don't have the Access section, just the What to do if the lookup record is deleted? option. If the parent record is deleted, you can choose to blank the field or throw an error so that the user is forced to update this relation before deleting the parent.

Field history tracking won't record the lookup field's deletion.

As lookup is not a required field (unlike a master-detail field), you can decide to put it as Required.

Filters apply the same way that we saw earlier when we looked at the master–detail field type.

If the main object is a custom object, then you can ask Salesforce Support to enable the Delete this record also option, which makes the lookup close to a master–detail relation, at least regarding the deletion behavior: this is called cascading delete.

Be aware that cascading delete allows a user to delete a child record they may not have access to.

Lookups can reference the same object type (which is not allowed in master–detail relationships), creating a so-called self-relationship: the only limitation is that you cannot look up a record with itself (this is called a circular reference).

You can convert a lookup relation into a master–detail relation only if the child records have a field for the master record, whereas you can convert a master–detail into a lookup only if you don't have any roll-up field on the master object. A special kind of lookup relationship is the self relationship—that is, a lookup that points to the same object type it is originating from. For example, the Account, Case, and Campaign objects all have a Parent lookup field that points to the same object type.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.120.202