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

Advanced aspects of object relationships

As experienced administrators, we already know the basics of the relationships between Salesforce objects: they are links between different objects that allow you to connect different records all together. The best and easiest way to get a view of all relations between objects is the Schema Builder, which can be found at Setup | Objects and Fields | Schema Builder.

When we have a lot of relations, having a whole picture of how the objects relate to each other can be a hard job, and this tool can help to untangle the problem. Be careful! Don't select all the objects in your org; otherwise, all we will see is a plate of spaghetti, as shown in the following screenshot:

Using Schema Builder to inspect object relationships

On the left sidebar, let's select a few objects, such as Account, Contact, Case, and Opportunity. We will get the following view:

Account-related relations

Each connector starts from the child object (the end with the small circle) and ends up on the parent object. We can then deduce the following:

  • The Case object is related to itself (which means that it is related to another record of the same type), Contact, and Account.
  • The Contact object is related to itself (if we have a look at all of the fields belonging to Contact, we'll find the ReportsTo field, which relates a contact with a parent contact) and to its parent Account.
  • The Opportunity object has two relations with the Account object (one is the Account field and the other is PartnerAccount field).
  • Finally, the Account object has a single relation with itself (the ParentAccount field).

If we add the User and Contract objects to this picture, the mess becomes excessive, and it isn't so easy to deduce every relation (try it yourself).

And all of this is all about standard relations on the Sales/Service Cloud data model. Imagine how much spaghetti you can add with custom relationships!

Salesforce provides different kinds of relationships between objects. These are as follows:

  • Master–detail relationships
  • Many-to-many relationships
  • Lookup relationships
  • Hierarchical relationships
  • External relationships

We'll also be covering a special kind of field called a roll-up field, and considerations about formula fields regarding relationships.

主站蜘蛛池模板: 永安市| 兖州市| 长治县| 东辽县| 福海县| 永州市| 从化市| 平遥县| 凌云县| 勃利县| 离岛区| 林口县| 定日县| 丰顺县| 台东县| 资兴市| 怀柔区| 龙南县| 大方县| 安阳县| 铜梁县| 桃园县| 柳林县| 开原市| 集贤县| 临颍县| 攀枝花市| 沙湾县| 航空| 富阳市| 新龙县| 民勤县| 尉犁县| 康马县| 开阳县| 山东省| 萍乡市| 巴林左旗| 威宁| 谢通门县| 鹤山市|