Object Relationships

Your end users will often need to associate one object's records with the records of another object. To enable this type of association between records, you must first create a relationship between those two objects.

For example, maybe your users want to track the opportunities that get created for an account.

In this example, you will create a one-to-many relationship between the account and opportunity objects, and then expose a list of opportunities as a subtab on the account's details page. This lets users search for and add one or more opportunities to a single account record. When creating relationships between objects, there are four types of relationships that you can pick from in Application Composer. Each type of relationship has its characteristics and advantages. In general, they all let you use a subtab to create or assign one or more records from one object to a record from another object.

Review these aspects of using and managing relationships in Application Composer before you begin to create relationships between objects:

  • Relationship types

  • Adding subtabs

Relationship Types

Application Composer lets you create either a one-to-many relationship, or a many-to-many relationship. Across these two categories, there are four types of relationships that you can pick from when creating a relationship.

  • Parent child relationship. A parent child relationship is a one-to-many relationship: one parent record can have many children records. When you create a child object, it's created specifically in the context of its parents. A child object doesn't have its own work area, and the child object's records are deleted if the parent objects is deleted.

  • Dynamic choice list relationship. A dynamic choice list field provides a list of values from a source object, which your users can select and associate with a target object. When you define the dynamic choice list field, Application Composer automatically creates a one-to-many relationship between the source object and target object.

  • Reference relationship. You can also manually create a one-to-many relationship, where you can specify a source object and target object. Thus, this type of relationship is similar to a dynamic choice list relationship. The only drawback is that you don't get a dynamic choice list field to add on the target object's work area. A reference relationship only gives you the ability to add a subtab to the source object's details page, showing a list of all the target object records that are associated with a single source object record.

    Once you create a one-to-many relationship, you can't delete it.

  • Many-to-many relationship. Create a many-to-many relationship where, similar to a one-to-many relationship, you can specify a source object and target object. However, with one-to-many relationships, you can add a subtab only to the source object's details page. Many-to-many relationships let your users add one or more records from one object to one or more records from another object.

    Once you create a many-to-many relationship, you can't delete it.

Adding Subtabs

After you create relationships between objects, you can then expose one object's records on a subtab that's displayed on the other object's details page.

When adding a subtab to an object's details page, you select to add a Child or Related Objects subtab from the object's Pages Overview page. Application Composer lets you add a subtab based on any target object that has a relationship with the current object as the source object. Subtabs are discussed in related topics.