What is Apex Connector Framework in Salesforce

The Apex Connector Framework is used to create a custom adapter that will be used for Salesforce Connect. Simply put, it is a set of both classes and methods that are provided by the DataSource namespace.

This framework allows you to make customized adapters. Your organization can then use these custom adapters to connect to data located on an outside source. They give you additional resources that you can use when the adapters in Salesforce Connect doesn’t meet your needs.

There are a few key concepts that help these frameworks perform their tasks effectively. They are the following:

Using External IDs

You will need to access data that is outside your organization. You will need an external ID to connect to external objects. It is a standard field that will come from the DataSource.Column. The field is aptly named as ExternalID.

Filters

The Apex Connector Framework also has filters. The DataSource.QueryContext will usually have only one DataSource.TableSelection, although it can really have more than one. The filter property will be contained in every TableSelection. In a SOSL or SOQL query, it will represent the WHERE clause.

Using the Apex Connector Framework with queryMore

When making API queries, custom adapters that were created for the Apex Connector Framework do not automatically support queryMore. The solution is in the implementation. The result sets should be broken up into smaller batches.

You can then use the queryMore method to iterate over them via SOAP API. Note that 500 records is the default batch size, but you can always adjust that in the query call.

Paging

Salesforce will usually break large sets of records into smaller batches in the user interface. It will usually just display one batch when that happens. To support paging, you should implement client driven or server driven paging.

Callouts

Custom adapters can make callouts just like other Apex codes. Just remember to implement authentication parameters into your callouts if an external source will require it.

Leave a Reply

Close Menu