Check Salesforce Einstein Activity Capture enabled using Apex

Check Salesforce Einstein Activity Capture enabled using Apex

When Salesforce Einstein Activity Capture(EAC) is enabled and configured, specific objects and fields become available or are populated.

ActivityUsrConnectionStatus object (for user connection status): This object stores the connection status for users with EAC.

Use the following sample Apex code to find or check whether the Salesforce Einstein Activity Capture feature is enabled or not using Salesforce Apex.

Sample Apex Code:

Map < String, Schema.SObjectType > globalDescription = Schema.getGlobalDescribe();

if ( globalDescription.containsKey( 'ActivityUsrConnectionStatus' ) ) {
    
    System.debug(
        'EAC is enabled.'
    );
    
} else {
    
    
    System.debug(
        'EAC is not enabled.'
    );
    
}

Leave a Reply