DEV Community

bhanukarkra
bhanukarkra

Posted on

Salesforce Admin Learning - Part 2

Master-Detail Relationship

1) It creates the parent(master) child(Detail) relationship between objects.
2) If we delete master records then detail (Child) records are deleted.
3) Rollup-summary field can be created in a master-detail relationship.
4) We can have maximum 2 master details on an object
5) Master is required field on the child object.

Look up Relationship :

1) Look up relationship creates relations between two objects.
2) If we delete any object then another object not get's deleted.
3) We can have maximum 25 lookups on an object.
4) Parent is not required in the child record.
5) Rollup-summary field can't be created in this relationship.

Note You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.

Note You can convert a lookup relationship to a master-detail relationship, but only if the lookup field in all records contains a value.

Roll up summary

A roll-up summary field calculates values from related records.
We can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record.

Roll-up summary field has the following functions:

  • Count() - Count displays the record count. It calculates the number of child records in the master-detail relationship.
  • Min() - Min calculates the least values for a specified field on the child records. Number, currency, percent, date and date/time the fields are available for Min calculations.
  • Max() - Max calculates the highest values for a specified field on the child records. Number, currency, percent, date and date/time the fields are available for Max calculations.
  • Sum() - Sum Calculates the sum of the values of a specified field on child record. Number, currency and the percent fields are available for sum calculations.

Top comments (0)