Object Reference for the Salesforce Platform
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');
91// add the UserEmailCalendarSync users to your list
2usersToAdd.add(user1);
3usersToAdd.add(user2);
41// 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);