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.
CalendarView
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()
Special Access Rules
All fields and entities referenced by field values must be accessible by the CalendarView creator even if the creator isn’t the CalendarView owner.
Fields
| Field | Details |
|---|---|
| Color |
|
| CurrencyIsoCode |
|
| DateHandlingType |
|
| DisplayField |
|
| EndField |
|
| FillPattern |
|
| IsDisplayed |
|
| ListViewFilterId |
|
| Name |
|
| OwnerId |
|
| PublisherId |
|
| SobjectType |
|
| StartField |
|
Usage
To distribute a CalendarView to multiple users, IDs can be pulled from a group, user list, or profile. For this example, a CalendarView based on opportunity close dates is being distributed to a sales team in a public group, Sales Group:
1Group userGroup = [SELECT Id FROM Group WHERE Name = 'Sales Group' LIMIT 1];
2List<Id> groupId = new List<Id>();
3groupId.add(userGroup.id);
4List<GroupMember> groupMembers = [SELECT UserOrGroupId FROM GroupMember
5 WHERE GroupId IN: groupId];
6
7List<CalendarView> calendarViews = new List<CalendarView>();
8for (GroupMember groupMember : groupMembers) {
9 CalendarView calendarView = new CalendarView(name = 'Opportunity Close Dates’,
10 SobjectType = 'Opportunity', StartField = 'CloseDate', DisplayField =
11 'Name', OwnerId = groupMember.UserOrGroupId);
12 calendarViews.add(calendarView);
13}
14insert calendarViews;Associated Objects
This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.
- CalendarViewChangeEvent (API version 62.0)
- Change events are available for the object.