Which type of relationships can be defined with external objects choose 2 answers?

In this article, we are going to see how to use Indirect lookup relationship using External objects in Salesforce. Before going into deep about indirect relationship, let us look at External objects at high level.

In this article, we are going to see how to use Indirect lookup relationship using External objects in Salesforce. Before going into deep about indirect relationship, let us look at External objects at high level.

External Object: 

If one needs to access data from external systems in Salesforce,  then we can make use of External object feature. It can be implemented based on three relationships mentioned below:

1. Lookup Relationship

2. External Lookup Relationship

3. Indirect Lookup Relationship

Lookup Relationship: 

It links a child Standard, Custom, or External object to a parent Standard or Custom object. It should be used only if there is a column that has Salesforce record Id.

External Lookup Relationship: 

It links a child Standard, Custom, or External object to a parent External object. Default External Id field on parent external object is matched against the external lookup relationship field. External Column Name will be used to map the child External lookup field.

Indirect Lookup Relationship: 

It links a child External object to a parent Standard or Custom object. External child object’s indirect lookup relationship field will be mapped to custom unique + external Id on parent object.

Now let us discuss in detail about indirect lookup relationship configuration with an example.

Below example shows an Order [External Child Object] associated with Account [Standard Salesforce Parent Object].

Before creating relationship with those two above objects, it is mandatory to create/specify the external data source and external object as shown in the screenshot below.

Go to Setup -> App Setup -> Develop -> External Data Source and create new data source as below and save it.

Once the external data source is saved, it will show ‘Validate and Sync’ button which allows you select the table which you want to include under external object.  In this example Orders and OrderDetails are selected.

Since in this indirect lookup relationship example, Order will be the child and hence we need to change the data type of Customer Id to indirect lookup as below. While changing data type to indirect lookup, it will require you to select ‘relate to’ object and ‘target field’. ‘Account’ is the “relate to” object and automatically created Customer Id on Account object is the target field.

Based on the customer Id specified on Account, it will display the associated external child Order object in its related list.

Standard Account object is the parent of external Order object. So it should be mapped to unique+external Id [Customer Id field]. If there is no field, it will create one field with the specified data type when you relate Order object with Account object.

For this below Order object, customer Id is ‘3’ and it should be specified in the account’s customer Id. Finally,  it will display all the associated orders of account [based on customer Id].

Which are the two types of object relationships in Salesforce?

In salesforce there are basically 2 types of relationship fields: Master-Detail Relationship. Lookup Relationship.

What is external relationship and its types in Salesforce?

External Lookup Relationships are used when you want to connect a child object to a parent External object. The child object can either be a Standard, Custom, or an External object. This type of relationship uses an External ID to correctly map the child object with the parent External object.

Which relationship can be defined on the user object?

Hierarchical relationships are a special type of lookup relationship. The main difference between the two is that hierarchical relationships are only available on the User object. You can use them for things like creating management chains between users.

What are external objects?

External objects are similar to custom objects, but external object record data is stored outside your Salesforce organization. For example, perhaps you have data that's stored on premises in an enterprise resource planning [ERP] system.

Bài Viết Liên Quan

Chủ Đề