Advanced DataSources

External DataSources are mostly used when you want to retrieve data from an external server and display it together with your Salesforce data. Since the data is retrieved using a user-created Apex Class, it has the advantage of being able to retrieve data more freely than with internal Salesforce data sources.


1

Writing an Apex Class

When writing an Apex class, you must implement the interface provided by SmallBuilder.

2

Advanced Data Source Configuration

Once the Apex class implementation is complete, proceed with the Advanced Data Source Configuration in the builder.

For example, if you want to fetch real-time inventory numbers from an external server or ERP system, then you can write Rest API code in an Apex Class and point it to an external data source. Then, you will be able to view that data in the Line-Item Configurator.

  • Properties

    Describing properties of external DataSources.

  • Creating an Apex Class

    Before you can use an external data source, you must write an Apex Class. Implement the SBLD.DataSourceService.Fetchable interface provided by the package by implementing it in the Apex Class you want to write.

  • Example

    Under construction.


Properties

External DataSource properties are listed below.

Item
Description
Req.

Apex Class Name

The name of the Apex Class used to import external data.

✔️

Key Field

This is the field API name for mapping data which has been retrieved through the DataSource.

✔️

Parent Field Parameters

Represents fields from the Parent object which are to be passed as parameters.

Lookup Field Parameters

Represents fields from the Lookup object which are to be passed as parameters.

Active

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

✔️

Creating an Apex Class

Before you can use an external data source, you must write an Apex Class. Implement the SBLD.DataSourceService.Fetchable interface provided by the package by implementing it in the Apex Class you want to write.

Classes implementing SBLD.DataSourceService.Fetchable must implement the execute() method.

You can get information from the Parent or Lookup objects through the gets() method in SBLD.DataSourceService.Parameter.

To pass the result to the Line-Item Configurator, we use the class below.

SBLD.DataSourceServiceAction Class

Specifies an Action for each line in the target (Lookup or Line-item). An Action is an operation that maps a DataSource value to a Lookup or Line-item field.

  • setKeyValue(Object keyValue) Sets the Key value to find the target record for the Lookup or Line-item.

  • putSourceToTargetField(Object sourceValue, String targetField) Assigns a data source value to a Lookup or Line-item field.

SBLD.DataSourceService.Result Class

Adds the mapped Action to the return value.

  • addAction(SBLD.DataSourceServiceAction action) Adds an Action to the SBLD.DataSourceService.Result instance.

Example

Under construction! Contact us if you need further help.

Last updated

Was this helpful?