Object Reference for the Salesforce Platform
Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
UserEmailCalendarSync
Supported Calls
create(), describeSObjects(), query(), update(), upsert()
Special Access Rules
To access this object, enable Einstein Activity Capture in your org.
Fields
| Field | Details |
|---|---|
| AssignedId |
|
| ConfigurationId |
|
Usage
Use UserEmailCalendarSync to add and remove users to an Einstein Activity Capture configuration. You can add users to a configuration via a user ID or a profile ID. You can add a profile to only one configuration and assign a profile to only one user.
1// Create a list of UserEmailCalendarSync records
2List<UserEmailCalendarSync> usersToAdd = new ArrayList<>();
3
4// Populate the UserEmailCalendarSync record with the ID of
5// the user or profile, and with the ID of the Activity Capture configuration you are adding them to
6UserEmailCalendarSync user1 = new UserEmailCalendarSync(ConfigurationId = '0063xxxxxxxxxxx', AssignedId = '005xxxxxxxxxxxx');
7
8UserEmailCalendarSync user2= new UserEmailCalendarSync(ConfigurationId = '0063xxxxxxxxxxx', AssignedId = '005xxxxxxxxxxxx');1// add the UserEmailCalendarSync users to your list
2usersToAdd.add(user1);
3usersToAdd.add(user2);1// Insert the list of UserEmailCalendarSync into the database
2Database.SaveResult[] results = Database.insertImmediate(usersToAdd);This example removes a user from an Einstein Activity Capture configuration.
To remove a user, call UserEmailCalendarSync(), passing in null for ConfigurationId.
1UserEmailCalendarSync user2Remove= new UserEmailCalendarSync(ConfigurationId = "", AssignedId ='005xxxxxxxxxxxx');
2Database.SaveResult results =Database.insertImmediate(user2Remove);