Discovery

The discovery features of WireBootstrap data sourcesarrow-up-right allow a data service to tell consumes about what information the data service can supply.

Discovery calls to Salesforce in WireBootstrap for meta data use the object resource of the REST API. For details on this resource, visit Working with Meta Dataarrow-up-right.

Objects

Use the discoverEntitiesAsync method on a data source to get a list of objects (entities) in Salesforce.

const source = new wire.data.DataSource("sf", {
    ...
});

const tblEntities = await.source.discoverEntitiesAsync();

Discover results are returned in a WireBootstrap DataTablearrow-up-right object.

...

const tblEntities = await.source.execAsync(query);

// grab an array of the first 10 objects ordered by name
const rows = tblEntities.select().top(10).orderBy("Name").rows();

To filter the call to a single object, use the optional configuration parameter setting the entity property to the name of the object.

Fields

Use the discoverFieldsAsync method on a data source to get a list of fields for an object in Salesforce. Pass the name of the entity in the entity property of the configuration parameter.

Results

The datatable returned from discover calls contains the list of records requested from Salesforce. However, the response returned from Salesforce contains much more data than can be represented in a WireBootstrap datatable.

The service providerarrow-up-right for the WireBootstrap for Salesforce Data Connector has an extension method called results which will return the raw results from the last call to Salesforce.

For more on service provider extensions methods, visit Provider Extensionsarrow-up-right.

Last updated