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

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.

主站蜘蛛池模板: 上饶市| 常宁市| 台中县| 武鸣县| 当涂县| 涟水县| 榆树市| 昌图县| 治多县| 乌拉特后旗| 普定县| 雷山县| 武城县| 吉隆县| 伊吾县| 五河县| 东阿县| 丹棱县| 科技| 长丰县| 眉山市| 周口市| 株洲县| 西城区| 温泉县| 麻阳| 阜新| 隆子县| 砚山县| 沁源县| 景泰县| 弥勒县| 沾化县| 临夏市| 贺州市| 集贤县| 塔城市| 汨罗市| 汾阳市| 永胜县| 冀州市|