Represents a calendar appointment event.
create(), update(), delete(), query(), queryAll(), search(), retrieve(), getDeleted(), getUpdated(), describeSObjects(), upsert()
| Field | Field Type | Field Properties | Description |
|---|---|---|---|
| AccountId | reference | Filter | ID of the related Account. |
| ActivityDate | date | Create | If the Event IsAllDayEvent flag is set to true (indicating
that it is an all day Event), then the Event due date information
is contained in the ActivityDate field. This field is a date field with a timestamp
that is always set to midnight in the Coordinated Universal Time (UTC)
time zone. The timestamp is not relevant, and you should not attempt
to alter it to account for any time zone differences. Label is Due Date Only. This field is required in version 12.0 and earlier if the IsAllDayEvent flag is set to true. The value for this field and StartDateTime must match, or one of them must be null. |
| ActivityDateTime | dateTime | Create | If the Event IsAllDayEvent flag is set to false (indicating
that it is not an all day Event), then the Event due date information
is contained in the ActivityDateTime field. This field is a regular Date/Time field
with a relevant time portion. The time portion is always transferred
in the Coordinated Universal Time (UTC) time zone. You need to translate
the time portion to or from a local time zone for the user or the
application, as appropriate. Label is Due Date Time. This field is required in version 12.0 and earlier if the IsAllDayEvent flag is set to false. The value for this field and StartDateTime must match, or one of them must be null. |
| Description | textarea | Create | Text description of the event. Limit: 32,000 characters. |
| DurationInMinutes | int | Create | The event length, in minutes. Note that even though this represents
a temporal value, it is an integer type—not a dateTime type. This field is required in version 12.0 and earlier if IsAllDayEvent is false. In version 13.0 and later, this
field is optional based on the following:
|
| EndDateTime | dateTime | Create | Available in version 13.0 and later. This field is optional
based on the following:
|
| IsAllDayEvent | boolean | Create | Indicates whether the ActivityDate field (true) or the ActivityDateTime field (false) is used to define the date and/or time of the event. Label is All Day Event. See also DurationInMinutes and EndDateTime. |
| IsChild | boolean | Defaulted on create | Indicates whether the event is a child of another event (true) or not (false). |
| IsDeleted | boolean | Defaulted on create |
Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted. |
| IsGroupEvent | boolean | Defaulted on create | Indicates whether the event is a group event with multiple attendees (true) or not (false). |
| IsPrivate | boolean | Create | Indicates whether users other than the creator of this event can (false) or cannot (true) see the event details when viewing the event user's calendar. However, users with the “View All Data” or “Modify All Data” permission can see private events in reports and searches, or when viewing other users' calendars. Private events cannot be associated with opportunities, accounts, cases, campaigns, contracts, leads, or contacts. Label is Private. |
| IsRecurrence | boolean | Create | Indicates whether the event is scheduled to repeat itself (true) or only occurs once (false). This is a read only field on update, but not on create. If this field value is true, then RecurrenceEndDateOnly, RecurrenceStartDateTime, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. See Recurring Events. Label is Create recurring series of events. |
| IsReminderSet | boolean | Create | Indicates whether the event is a reminder (true) or not (false). |
| IsVisibleInSelfService | boolean | Defaulted on create | Indicates whether the event can be viewed in the Customer Self-Service Portal (true) or not (false). |
| Location | string | Create | The location of the event. |
| OwnerId | reference | Create | ID of the user who owns the event. Label is Assigned to ID. |
| RecurrenceActivityId | reference | Read-only. Not required on create. ID of the main record of the recurring event. Subsequent occurrences have the same value in this field. | |
| RecurrenceDayOfMonth | int | Create | The day of the month on which the event repeats. |
| RecurrenceDayOfWeekMask | int | Create | The day or days of the week on which the
event repeats. This field contains a bitmask. For each day of the
week, the values are as follows:
|
| RecurrenceEndDateOnly | date | Create | The last date on which the event repeats. For multiday recurring events, this is the day on which the last occurrence starts. |
| RecurrenceInstance | picklist | Create | The frequency of the recurring event. For example, “2nd” or “3rd.” |
| RecurrenceInterval | int | Create | The interval between recurring events. |
| RecurrenceMonthOfYear | picklist | Create | The month of the year on which the event repeats. |
| RecurrenceStartDateTime | dateTime | Create | The date and time when the recurring event begins. Must be a date and time before RecurrenceEndDateOnly. |
| RecurrenceTimeZoneSidKey | picklist | Create | The time zone associated with the recurring event. For example, “UTC-8:00” for Pacific Standard Time. |
| ReminderDateTime | dateTime | Create | Represents the time the reminder is scheduled to fire, if IsReminderSet is set to true. If it is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value. |
| RecurrenceType | picklist | Create | Indicates how often the event repeats. For example, daily, weekly, or every Nth month (where “Nth” is defined in RecurrenceInstance). |
| ShowAs | picklist | Create | Indicates how this event appears when another user views the calendar: Busy, Out of Office, or Free Time. Label is Show Time As. |
| StartDateTime | dateTime | Create | Available in version 13.0 and later. The start date and time
of the event. If the Event IsAllDayEvent flag is set to true (indicating that it is an all day Event), then the Event start date information is contained in the StartDateTime field. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant, and you should not attempt to alter it to account for any time zone differences. If the Event IsAllDayEvent flag is set to false (indicating that it is not an all day Event), then the Event start date information is contained in the StartDateTime field. The time portion is always transferred in the Coordinated Universal Time (UTC) time zone. You need to translate the time portion to or from a local time zone for the user or the application, as appropriate. If this field has a value, then ActivityDate and ActivityDateTime must either be null or match the value of this field. |
| Subject | combobox | Create | The subject line of the event, such as Call, Email, or Meeting. |
| Type | picklist | Create | The type of event, such as Call, Email, or Meeting. |
| WhatId | reference | Create | ID of a related Account, Opportunity, Campaign, Case, or custom object. Label is Opportunity/Account ID. |
| WhoId | reference | Create | ID of a related Contact or Lead. If the WhoId refers to a lead, then the WhatId field must be empty. Label is Contact/Lead ID. |
Use Events to manage calendar appointments.
Queries on events will be denied before they time out if they involve amounts of data that are deemed too large. In such cases, OPERATION_TOO_LARGE is returned. If you receive the OPERATION_TOO_LARGE error message, refactor your query to return or scan a smaller amount of data.
Alternatively, in version 13.0 and later, you can find events with a specific due date by filtering on StartDateTime. For example, to find all events with a due date of February 14, 2003, filter with the StartDateTime greater than or equal to midnight on February 14, 2003 in the user's local time zone AND less than or equal to midnight on February 15, 2003 in the user's local time zone.
The following table describes the usage of recurrence fields. Each recurrence type must have all of its properties set. All unused properties must be set to null.
| RecurrenceType Value | Properties | Example Pattern |
|---|---|---|
| RecursDaily | RecurrenceInterval | Every second day |
| RecursEveryWeekday | RecurrenceDayOfWeekMask | Every weekday - cannot be Saturday or Sunday |
| RecursMonthly | RecurrenceDayOfMonth RecurrenceInterval | Every second month, on the third day of the month |
| RecursMonthlyNth | RecurrenceInterval RecurrenceInstance RecurrenceDayOfWeekMask | Every second month, on the last Friday of the month |
| RecursWeekly | RecurrenceInterval RecurrenceDayOfWeekMask | Every three weeks on Wednesday and Friday |
| RecursYearly | RecurrenceDayOfMonth RecurrenceMonthOfYear | Every March on the twenty-sixth day of the month |
| RecursYearlyNth | RecurrenceDayOfWeekMask RecurrenceInstanceRecurrenceMonthOfYear | The first Saturday in every October |
For information about working with archived events, see Archived Activities.