官术网_书友最值得收藏!

Object relationships

You can relate an object to other objects in Salesforce. For example, relating a custom object Expense to custom object Project. With this relation, you'll know which expense record is used for which project. Project, in this example, will be considered as the parent object, and Expense as a child object. From the record-level perspective, one parent can have many children, while the child can only have one parent. To build this relationship from the child object, create a Lookup Relationship or Master-Detail Relationship field to the parent object.

There are three types of object relationships in Salesforce, which are as follows:

  • Master-Detail Relationship
  • Lookup Relationship
  • Hierarchical Relationship

The following table compares the Master-Detail Relationship and Lookup Relationship:

To create a Master-Detail Relationship for an existing object that contains records as a child object, you can initially set it as a Lookup Relationship, populate the parent field for all child records, and then change the relationship to Master-Detail Relationship.

Hierarchical Relationship is a special Lookup relationship available for the user object only. It lets users use a lookup field to associate one user with another, which does not directly or indirectly refer to itself. For example, you can create a custom Hierarchical Relationship field to store each user's reporting manager.

You can build a many-to-many object relationship using two Master-Detail Relationships in a single custom object; this is known as a Junction object.
主站蜘蛛池模板: 阜平县| 长春市| 乐业县| 通州区| 遵义县| 阜南县| 博野县| 内乡县| 神木县| 塔河县| 郎溪县| 沅江市| 灵丘县| 肇源县| 新乡县| 渝北区| 乌拉特前旗| 阆中市| 蛟河市| 嘉善县| 宿松县| 山西省| 运城市| 秦皇岛市| 汉沽区| 临颍县| 新民市| 弥渡县| 南川市| 吴川市| 临澧县| 含山县| 洛扎县| 贵州省| 自贡市| 文水县| 桑日县| 平和县| 江城| 山阳县| 西乌珠穆沁旗|