Newer Version Available
Creating and Undeleting a Person Account
The contact change event contains all contact standard and custom fields. The contact change event doesn’t contain the account fields of the person account.
The Name field is included in both the account and contact change events for a new or undeleted person account.
Example
These two change events are generated when a person account is created. The first event is for the Account standard object. The account change event contains the Name field, which is the person account name. This field is also included in the contact change event. The fields in the account event that start with the Person prefix, such as PersonHasOptedOutOfFax, are standard contact fields. The second event is for the Contact standard object. The contact has a custom field named CustomContactField__c, which is part of both the contact and account change events. In the account change event, the contact custom field ends with the __pc prefix.
1// Change event for Account
2{
3 "data": {
4 "schema": "evwnhdWzZSldH9t0auS_8A",
5 "payload": {
6 "ChangeEventHeader": {
7 "entityName": "Account",
8 "recordIds": [
9 "001xx000003DI77AAG"
10 ],
11 "changeType": "CREATE",
12 "changeOrigin": "",
13 "transactionKey": "00084908-e206-6620-ea21-f2d8b15308b4",
14 "sequenceNumber": 1,
15 "isTransactionEnd": false,
16 "commitTimestamp": 1524766095920,
17 "commitNumber": 321169007,
18 "commitUser": "005xx000001SwlRAAS"
19 },
20 "Name": {
21 "FirstName": "John",
22 "LastName": "Doe"
23 },
24 "RecordTypeId": "012xx000000238RAAQ",
25 "Phone": "(415) 555-1212",
26 "OwnerId": "005xx000001SwlRAAS",
27 "CreatedDate": "2018-04-26T18:08:14.000Z",
28 "CreatedById": "005xx000001SwlRAAS",
29 "LastModifiedDate": "2018-04-26T18:08:14.000Z",
30 "LastModifiedById": "005xx000001SwlRAAS",
31 "PersonContactId": "003xx000004TtDhAAK",
32 "PersonHasOptedOutOfEmail": false,
33 "PersonHasOptedOutOfFax": false,
34 "PersonDoNotCall": false,
35 "CustomContactField__pc": "001",
36 },
37 "event": {
38 "replayId": 1096
39 }
40 },
41 "channel": "/data/ChangeEvents"
42}
43
44// Change event for Contact
45{
46 "data": {
47 "schema": "rDKDoGY8NI7ENvtFsDUdKg",
48 "payload": {
49 "ChangeEventHeader": {
50 "entityName": "Contact",
51 "recordIds": [
52 "003xx000004TtDhAAK"
53 ],
54 "changeType": "CREATE",
55 "changeOrigin": "",
56 "transactionKey": "00084908-e206-6620-ea21-f2d8b15308b4",
57 "sequenceNumber": 2,
58 "isTransactionEnd": true,
59 "commitTimestamp": 1524766095920,
60 "commitNumber": 321169007,
61 "commitUser": "005xx000001SwlRAAS"
62 },
63 "AccountId": "001xx000003DI77AAG",
64 "IsPersonAccount": true,
65 "Name": {
66 "FirstName": "John",
67 "LastName": "Doe"
68 },
69 "Phone": "(415) 555-1212",
70 "OwnerId": "005xx000001SwlRAAS",
71 "HasOptedOutOfEmail": false,
72 "HasOptedOutOfFax": false,
73 "DoNotCall": false,
74 "CreatedDate": "2018-04-26T18:08:14.000Z",
75 "CreatedById": "005xx000001SwlRAAS",
76 "LastModifiedDate": "2018-04-26T18:08:14.000Z",
77 "LastModifiedById": "005xx000001SwlRAAS",
78 "CustomContactField__c": "001"
79 },
80 "event": {
81 "replayId": 1097
82 }
83 },
84 "channel": "/data/ChangeEvents"
85}