Basic DataSource: Retrieve Related Object Data

If you want to simply fetch related object data, consider using Basic DataSource settings. You can select an object related to Lookup or Line Item and map the fields of the retrieved object to the Lookup or Line Item fields via DataSource.

Basic DataSource Settings

No.
Attribute
Description
Req.

1

Source Object

Specify the Salesforce objects that you want to source data from.

2

Query

Click the Wizard button to open the Build Query layout. You can use the Query Wizard to easily build queries by searching for the correct fields to use. Filters are entered in the format of a SOQL WHERE clause.

3

Evaluation Event

Set the execution timing for the DataSource.

  • On Initialization: Executes when a new Line Item is added.

  • On Loading: Executes when the Line Item screen is loaded.

  • Before Save: Executes before a Line Item is saved.

Available only for Line Items.

4

Active

Turns the DataSource on or off. It must be active to be used.

5

Map the fields from the DataSource object to the Lookup or Line Item fields.

Actions

Actions involve mapping the data fetched from the DataSource to the fields in Lookup or Line Items. Through these actions, the DataSource values are applied to the designated fields.

No.
Attribute
Description
Req.

1

Order

Specify the order that mappings are carried out.

2

Source Field

Select the field from the DataSource object.

3

Target Field

Select the target field in Lookup or Line Item where the data will be mapped.

4

Key

The unique identifier used for mapping data between the DataSource and Lookup or Line Item. The Key determines the target for the mapped DataSource values.

Example

This example demonstrates the configuration of a Line Item Editor for Opportunity Products:

  • Parent: Opportunity

  • Line Item: OpportunityLineItem

  • Lookup: Product2

When the Lookup Object is set to Product2, users often want to display UnitPrice information. However, in Salesforce, the UnitPrice is stored in the PricebookEntry object, which is a child object of Product. Since UnitPrice cannot be fetched via a formula field, we use a DataSource to query the related PricebookEntry data.

  1. In the DataSource settings, specify the Source Object as PricebookEntry.

  2. (optional) Click Query Wizard to set up the query conditions: IsActive = true AND Pricebook2Id = {$Parent.Pricebook2Id}

  3. To match the PricebookEntry data to the Products, use the following settings:

    • Source Field: Product2Id

    • Target Field: Id

    • Key: true

  4. To display the Unit Price alongside the product data, add an Action and map the fields to a virtual column in Lookup:

    • Source Field: UnitPrice

    • Target Field: SBLI_Virtual1

Last updated

Was this helpful?