Newer Version Available
Create a Sample DataSource.Provider Class
Your DataSource.Provider class informs Salesforce of the functional and authentication capabilities that are supported by or required to connect to the external system.
If the external system requires authentication, Salesforce can provide the authentication credentials from the external data source definition or users’ personal settings. For simplicity, however, this example declares that the external system doesn’t require authentication. To do so, it returns AuthenticationCapability.ANONYMOUS as the sole entry in the list of authentication capabilities.
- To allow SOQL, the example declares the DataSource.Capability.ROW_QUERY capability.
- To allow SOSL and Salesforce searches, the example declares the DataSource.Capability.SEARCH capability.
- To allow upserting external data, the example declares the DataSource.Capability.ROW_CREATE and DataSource.Capability.ROW_UPDATE capabilities.
- To allow deleting external data, the example declares the DataSource.Capability.ROW_DELETE capability.
Lastly, the example identifies the SampleDataSourceConnection class that obtains the external system’s schema and handles the queries and searches of the external data.