当前位置:网站首页>Salesforce connect & external object

Salesforce connect & external object

2020-11-08 23:46:00 zero.zhang

This article references :

https://trailhead.salesforce.com/en/content/learn/modules/lightning_connect

https://help.salesforce.com/articleView?id=platform_connect_about.htm&type=5

We're doing it salesforce When developing , In addition to the need to understand the most basic front-end and back-end development , Also need to salesforce Design and government limit There are some basic understanding . For example, we know salesforce A table can create several fields , But no matter how many fields there are currently , The memory occupied by each data in this table is about 2K, Regardless of whether the data in the current table is stored 1 Fields or multiple fields .

Companies may choose different types of license, Different license Different data storage.
By inquiring salesforce help The document can be viewed as , Professional, Enterprise , Unlimited Edition All are 10G Data memory of
When our license Purchased data storage Finite time , We can give salesforce carry case Add money to expand ,plus Can increase 200M. However, not all scenarios require various extensions , Because expansion also means in salesforce There's more and more data in , When used, the relevant performance will also be affected . some case Maybe we want to use ERP Or data from other systems , The first thing we thought about was in salesforce Create a custom object Or a big object, And then the data migrates over , When the opposite system changes , adopt rest And then push the changed data back . Actually this kind of case Next salesforce Provides another possibility , That's what this article says salesforce connect as well as External Object.

One . Salesforce Connect

Salesforce Connect Is one that allows you to view , Search and modification are stored in salesforce Data outside the system . He gets

Most of the following scenarios are recommended when applicable salesforce connect:

1. You have a lot of data stored externally, but you don't want to copy it to your Salesforce org.
2. You need a small amount of data at all times
3. You need real-time access to the latest data
4. The data is stored in the cloud or back-end systems , But the hope is Salesforce org Display or process the data in .

It should be noted that , If you need to access a lot of external data frequently ,ETL(extract, transform, and load) Tools are still the best choice for optimal performance . We are using You need to evaluate whether you need to use salesforce connect still ETL Tools . From the above description, we can see that , When you want to reference an external system and satisfy most of the above scenarios , You need it Salesforce Connect, Other situations need to be operated according to the actual situation of the project .

Two . Salesforce Connect Simple setup and integration

The official gave a real business scenario demo, Here's a simple description . The system's customer orders and order details are maintained externally ERP System , The system administrator is required to view the order information and order details of the current customer in the customer details page . The order information and order details do not need to be maintained to salesforce System , There won't be a lot of data per customer information , Each visit needs to display the latest order information . For this business scenario, we recommend to consider using External Object. Steps are as follows :

1. establish External DataSource

First of all, in accordance with the trailhead Of demo To install a app exchange, Links are as follows :https://login.salesforce.com/packaging/installPackage.apexp?p0=04tE00000001aqG&isdtp=p1. It is used to install some fields that need to be used and others metadata. Once installed , Switch to classic in the future ,app Select to External Object,tab Select to Quickstart, It's normal to show a button be called Set Customer IDs , Click on this. button We'll show you the picture below in the future , Prove that the data initialization is successful , This is definitely not needed in actual projects , It's just trailhead Initialization to ensure that data can be correlated .

 

  After the initialization operation is finished , We started external data source The creation of , stay setup Search for external data source Click on the left item You can view the current system of external data source Information . Click on New External Data source You can create .

  We configure the relevant information as required , It should be noted that , Be sure to use authentication certificates in actual projects ,URL For the official demo data .

Click on Save Create one later External Data Source.

 2. establish External Object

When we're done creating External Data Source It's easier to create External Object 了 . We're going into what we just created External Data Source, Click on Validate And Sync Button .

  Here we only choose for external data Order as well as Order Detail Two External Object, Click on Sync, Click to generate External Object.

 setup Search for External Object, Click on the left to enter the relevant generated External Object 了 .

 3. Set the relationship between tables . This step is very important , We created external objects , Bound to external data source, The goal is to use this data , So figure out the relationship between the tables , It is important to understand the relationships between external objects and between external objects and internal objects . Current demo in , We can see , Account There is one or more Order, One Order There is one or more Order Detail. among Account yes salesforce Object, Order as well as Order Detail It's an external object , Let's find out the relationship according to the table below .

Type of Relationship( Type of relationship ) Child Object( Son Object) Parent Object( Father Object)

Must External Data Contain Salesforce IDs?

Whether the external data contains Salesforce Id

 Lookup  Standard, Custom, or External  Standard or Custom  Yes
 External Lookup  Standard, Custom, or External  External  No
 Indirect Lookup  External  Standard or Custom  No

  Through the chart above , We can see For external and internal objects and the relationship between external objects and external objects , There can be three types of relationships , Namely lookup / External Lookup / Indirect Lookup.

 lookup Type is used when the parent table is salesforce surface , The word list is External situation , also External Data Source Contains Salesforce Id Under the circumstances , Can be in External Object Created in lookup Type field , Related to salesforce On your watch ;

External Lookup be used for The parent table is the outer table , And the word list is salesforce Inside or outside , You can create a External Lookup The type field ;

Indirect Lookup The parent table is salesforce In the table , A word list is an external list , And not through salesforce Id relation , adopt Fields in the form of foreign keys are associated , You can create a Indirect Lookup The type field .

According to our present situation , Account and Order, because Order It's an external table , Apply to Indirect Lookup; Order and Order Detail Tables are all external tables , The father is External, So it can only be External Lookup.

When you know the type , We do this for the fields in the table change type operation , take Order In the table customerId Field modified to indirect lookup type , Related to account Of customer id Field ; Same reason Order Detail Of orderID Field modified to External Lookup type , Related to Order Tabular order id.

  These tables create relationships , in the future , We need to change account as well as order Of page layout, take related list Relevant information dragged out , This can be done in a foreign key associated with account In the associated list of the data of External Object Of Order Information and click in Order Check out Order Detail Information .

  summary : The article mainly talks about Salesforce Connect as well as External Object Simple use . You don't have to use , But when it comes to big projects , With this concept , Just know what scenario to use it .Salesforce What's amazing about the design is different functions, different suffixes . Custom table __c, Big Object Use __b, External Object Use __x, If you can understand the underlying knowledge, it must be a wonderful experience . Please point out any mistakes in the passage , Do you know the welcome message .

版权声明
本文为[zero.zhang]所创,转载请带上原文链接,感谢