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

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.

主站蜘蛛池模板: 垣曲县| 攀枝花市| 蒲江县| 来宾市| 松潘县| 杨浦区| 银川市| 菏泽市| 宜城市| 饶平县| 焉耆| 城口县| 徐汇区| 日照市| 乌兰察布市| 宁德市| 巴彦县| 上虞市| 洞头县| 桃园市| 奇台县| 新郑市| 宁安市| 顺昌县| 房山区| 江陵县| 澜沧| 富顺县| 荣成市| 石渠县| 郑州市| 江城| 商水县| 浑源县| 搜索| 大方县| 榆树市| 庆云县| 水富县| 高唐县| 徐闻县|