Newer Version Available

This content describes an older version of this product. View Latest

Event Invitees

Change events are generated for event invitees in addition to the calendar event record. When a Salesforce user is invited to a calendar event, a child calendar event record is created for the invitee. A child calendar event is an Event record with the IsChild field set to true and OwnerId set to the invitee’s user ID.

A child calendar event isn’t created for an invitee who isn’t a Salesforce user, such as a contact, a lead, or a resource. For each invitee added, an EventRelation record is created to represent the relationship to the calendar event. In a recurring series, child calendar events are created for invitees in each occurrence.

For example, if a calendar event is created with two invitees, three calendar event records are created in Salesforce: one record for the calendar event, and two records for the invitees. The three records result in three change events being generated on the channel for the Event standard object. In addition, two EventRelation records are created and generate two change events on the channel for EventRelation.

Example

These events are generated when creating a calendar event and inviting one user. The first change event is for the calendar event. The second change event is the child calendar event for the invitee, with IsChild set to true and OwnerID set to the invitee’s user ID. The third change event is for the EventRelation record representing the relationship between the invitee and the calendar event. Some fields in the example have been omitted for brevity.

1// Change event generated for the calendar event record.
2 {
3  "data": {
4    "schema": "3qM8RtdTpBOU8dTpXEegIw", 
5    "payload": {
6      "ChangeEventHeader": {
7        "entityName": "Event", 
8        "recordIds": [
9          "00UR00000031PadMAE"
10        ], 
11        "changeType": "CREATE", 
12        "changeOrigin": "", 
13        "transactionKey": "001459d4-3043-e8d4-a8cd-8f5d14e165f4", 
14        "sequenceNumber": 1,
15        "commitTimestamp": 1513387673982, 
16        "commitNumber": 8346652842658, 
17        "commitUser": "005R0000000IUUMIA4"
18      }, 
19      "Subject": "Product Requirements", 
20      "Location": "Orcas Room", 
21      "IsAllDayEvent": false, 
22      "ActivityDateTime": "2018-01-18T21:00:00Z", 
23      "ActivityDate": "2018-01-18", 
24      "DurationInMinutes": 60, 
25      "Description": "Let's meet to discuss product requirements.", 
26      "OwnerId": "005R0000000IUUMIA4", 
27       . . .
28      "IsArchived": false, 
29      "IsRecurrence": false, 
30      "ReminderDateTime": "2018-01-18T20:45:00Z", 
31      "IsReminderSet": true
32    }, 
33    "event": {
34      "replayId": 20
35    }
36  }, 
37  "channel": "/data/ChangeEvents"
38}
39
40// Change event generated for the child calendar event record for the invitee.
41{
42  "data": {
43    "schema": "3qM8RtdTpBOU8dTpXEegIw", 
44    "payload": {
45      "ChangeEventHeader": {
46        "entityName": "Event", 
47        "recordIds": [
48          "00UR00000031PaeMAE"
49        ], 
50        "changeType": "CREATE", 
51        "changeOrigin": "", 
52        "transactionKey": "001459d4-3043-e8d4-a8cd-8f5d14e165f4", 
53        "sequenceNumber": 2, 
54        "commitTimestamp": 1513387673982, 
55        "commitNumber": 8346652842658, 
56        "commitUser": "005R0000000IUUMIA4"
57      }, 
58      "Subject": "Product Requirements", 
59      "Location": "Orcas Room", 
60      "IsAllDayEvent": false, 
61      "ActivityDateTime": "2018-01-18T21:00:00Z", 
62      "ActivityDate": "2018-01-18", 
63      "DurationInMinutes": 60, 
64      "Description": "Let's meet to discuss product requirements.", 
65      "OwnerId": "005R0000000jVuLIAU", 
66      . . .
67      "IsRecurrence": false, 
68      "ReminderDateTime": "2018-01-18T20:45:00Z", 
69      "IsReminderSet": true
70    }, 
71    "event": {
72      "replayId": 21
73    }
74  }, 
75  "channel": "/data/ChangeEvents"
76}
77
78// Change event generated for the EventRelation record representing the 
79// relationship between the invitee and the calendar event.
80{
81  "data": {
82    "schema": "jmf7I1fmAlO8nf3MSyc30Q", 
83    "payload": {
84      "ChangeEventHeader": {
85        "entityName": "EventRelation", 
86        "recordIds": [
87          "0RER00000004DO1OAM"
88        ], 
89        "changeType": "CREATE", 
90        "changeOrigin": "", 
91        "transactionKey": "001459d4-3043-e8d4-a8cd-8f5d14e165f4", 
92        "sequenceNumber": 3,  
93        "commitTimestamp": 1513387673982, 
94        "commitNumber": 8346652842658, 
95        "commitUser": "005R0000000IUUMIA4"
96      }, 
97      "RelationId": "005R0000000jVuLIAU", 
98      "EventId": "00UR00000031PadMAE", 
99      "IsWhat": false, 
100      "IsParent": false, 
101      "IsInvitee": true, 
102      "Status": "New", 
103      "CreatedDate": "2017-12-16T01:27:53Z", 
104      "CreatedById": "005R0000000IUUMIA4", 
105      "LastModifiedDate": "2017-12-16T01:27:53Z", 
106      "LastModifiedById": "005R0000000IUUMIA4"
107    }, 
108    "event": {
109      "replayId": 22
110    }
111  }, 
112  "channel": "/data/ChangeEvents"
113}