Internal data sources
Last updated
Last updated
Internal DataSources are used when you want to look up related objects in Salesforce to present data together.
For example, if the Lookup object is specified as 'Product2' and you want to display the unit price from a 'PricebookEntry', you can use an internal data source to look up the 'PricebookEntry' that meets the criteria, and display the product and unit price together.
Describes each property of Internal data sources.
To combine data from a data source with the list, you must map the fields from the data source to fields in the list (you can create virtual fields to hold these values).
Field name or area | Description | Req. |
---|---|---|
Object search | Search for and select the target object in the data source. | βοΈ |
Enable | Enables the data source. You will not be able to use disabled data sources when builfing custom lists. | |
Description | Provide a description of the datasource. | |
Conditions | ||
To use data from a data source in a custom list, you need to map the data source fields to the columns in the list (you can use the virtual fields you set up earlier for this). | βοΈ |
To use data from a data source in a custom list, you need to map the data source fields to the columns in the list (you can use the virtual fields you set up earlier for this).
Field name or area | Description | Req. |
---|---|---|
Key | To match records in your data source with records in your list, select a key field to match records on. | βοΈ |
Actions | These map the data retrieved from the data source to the columns in your list. | βοΈ |
Click this button to add an Action. |
Area | Description |
---|---|
DataSource Field | Shows the fields available in the object specified in the data source. |
Lists Field | Shows the fields available in the object specified in the list. |
Virtual Field | Shows the virtual columns you created in the list. |
Results | Shows the results of which fields to map from the data source (on the left) to the custom list (on the right). |
You want to retrieve a list of products, so you specify the underlying object of the list as Product. You also want to display the list with the unit prices stored in the PricebookEntry object.
Click the β button to search for and select PricebookEntry
.
(optional) In the Condition field, enter Product2Id IN {$Current.Id}
(equivalent to a SOQL Where
statement).
To match the PricebookEntry data to the Products, click the pencil button to the right of the Key row.
In the pop-up window that opens, choose the following options and save:
Data source field: Product2Id
List field: Id
Press the Add Action
button to display the unit price of the PricebookEntry in the list column. Note that before completing this step you must have created a virtual column in the Datatable Setup screen as described above.
In the pop-up window that opens, choose the following options and save:
Data source field: UnitPrice
List field: SBLDVirtual1 (or whichever name you chose)
Create if you need to apply a condition when looking up objects in the data source (equivalent to a Where
clause in SOQL).
It may be easier to write your search query if you use the Field API Name Finder to find the appropriate field names.
When writing conditional statements using fields from the underlying object, be sure to use 'IN', not '='.
$Current
means the list's underlying object.
Correct example: Product2Id IN {$Current.Id}
Incorrect example: Product2Id = {$Current.Id}