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.

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.
Describing properties of external DataSources.
Before you can use an external data source, you must write an Apex Class. Implement the
SBLD.DataSourceService.Fetchableinterface provided by the package by implementing it in the Apex Class you want to write.Under construction.
Properties
External DataSource properties are listed below.
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.Resultinstance.
Example
Under construction! Contact us if you need further help.
Last updated
Was this helpful?