Newer Version Available
Apex Considerations for Salesforce Connect External Objects
Apex code can access external object data via any Salesforce Connect adapter, but some
requirements and limitations apply.
- These features aren’t available for external objects.
- Apex-managed sharing
- Apex triggers (However, you can create triggers on external change data capture events from OData 4.0 connections.)
- When developers use Apex to manipulate external object records, asynchronous timing and an active background queue minimize potential save conflicts. A specialized set of Apex methods and keywords handles potential timing issues with write execution. Apex also lets you retrieve the results of delete and upsert operations. Use the BackgroundOperation object to monitor job progress for write operations via the API or SOQL.
- Database.insertAsync() methods can’t be executed in the context of a portal user, even when the portal user is a community member. To add external object records via Apex, use Database.insertImmediate() methods.
-
If you use batch Apex with Database.QueryLocator to access external objects via an OData adapter for Salesforce Connect: