Newer Version Available

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

Creating and Undeleting a Person Account

When creating or undeleting a person account, the account change event contains both account and contact fields. It contains account record fields and some fields from the contact record. The contact fields that the account change event includes are all custom contact fields and some standard contact fields, which start with the Person prefix.

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 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  "ChangeEventHeader": {
4    "entityName": "Account",
5    "recordIds": [
6      "001ZL000001QS6mYAG"
7    ],
8    "changeType": "CREATE",
9    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
10    "transactionKey": "000a6a7b-b859-8ba4-2ab8-1a1babf66ff0",
11    "sequenceNumber": 1,
12    "commitTimestamp": 1714431097000,
13    "commitNumber": 71542214535,
14    "commitUser": "005ZL000000M0x1YAC",
15    "nulledFields": [],
16    "diffFields": [],
17    "changedFields": []
18  },
19  "Name": {
20    "Salutation": "Ms.",
21    "FirstName": "Martha",
22    "LastName": "Brown"
23  },
24  "Type": null,
25  "RecordTypeId": "012ZL0000008Td4YAE",
26  "ParentId": null,
27  "BillingAddress": {
28    "Street": "415 Mission Street",
29    "City": "San Francisco",
30    "State": "CA",
31    "PostalCode": "94105",
32    "Country": "US",
33    "Latitude": null,
34    "Longitude": null,
35    "GeocodeAccuracy": null
36  },
37  "ShippingAddress": null,
38  "Phone": "(415) 555-1212",
39  "Fax": null,
40  "AccountNumber": null,
41  "Website": null,
42  "Sic": null,
43  "Industry": null,
44  "AnnualRevenue": null,
45  "NumberOfEmployees": null,
46  "Ownership": null,
47  "TickerSymbol": null,
48  "Description": null,
49  "Rating": null,
50  "Site": null,
51  "OwnerId": "005ZL000000M0x1YAC",
52  "CreatedDate": 1714431097000,
53  "CreatedById": "005ZL000000M0x1YAC",
54  "LastModifiedDate": 1714431097000,
55  "LastModifiedById": "005ZL000000M0x1YAC",
56  "PersonContactId": "003ZL000001EDrPYAW",
57  "PersonMailingAddress": null,
58  "PersonOtherAddress": null,
59  "PersonMobilePhone": null,
60  "PersonHomePhone": null,
61  "PersonOtherPhone": null,
62  "PersonAssistantPhone": null,
63  "PersonEmail": null,
64  "PersonTitle": null,
65  "PersonDepartment": null,
66  "PersonAssistantName": null,
67  "PersonLeadSource": null,
68  "PersonBirthdate": null,
69  "PersonHasOptedOutOfEmail": null,
70  "PersonHasOptedOutOfFax": null,
71  "PersonDoNotCall": null,
72  "PersonLastCURequestDate": null,
73  "PersonLastCUUpdateDate": null,
74  "PersonEmailBouncedReason": null,
75  "PersonEmailBouncedDate": null,
76  "PersonIndividualId": null,
77  "PersonPronouns": null,
78  "PersonGenderIdentity": null,
79  "Jigsaw": null,
80  "JigsawCompanyId": null,
81  "AccountSource": null,
82  "SicDesc": null,
83  "CustomContactField__pc": "ABC"
84}
85
86
87// Change event for Contact
88{
89  "ChangeEventHeader": {
90    "entityName": "Contact",
91    "recordIds": [
92      "003ZL000001EDrPYAW"
93    ],
94    "changeType": "CREATE",
95    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
96    "transactionKey": "000a6a7b-b859-8ba4-2ab8-1a1babf66ff0",
97    "sequenceNumber": 2,
98    "commitTimestamp": 1714431097000,
99    "commitNumber": 71542214535,
100    "commitUser": "005ZL000000M0x1YAC",
101    "nulledFields": [],
102    "diffFields": [],
103    "changedFields": []
104  },
105  "AccountId": "001ZL000001QS6mYAG",
106  "IsPersonAccount": true,
107  "Name": {
108    "Salutation": "Ms.",
109    "FirstName": "Martha",
110    "LastName": "Brown"
111  },
112  "OtherAddress": null,
113  "MailingAddress": null,
114  "Phone": "(415) 555-1212",
115  "Fax": null,
116  "MobilePhone": null,
117  "HomePhone": null,
118  "OtherPhone": null,
119  "AssistantPhone": null,
120  "ReportsToId": null,
121  "Email": null,
122  "Title": null,
123  "Department": null,
124  "AssistantName": null,
125  "LeadSource": null,
126  "Birthdate": null,
127  "Description": null,
128  "OwnerId": "005ZL000000M0x1YAC",
129  "HasOptedOutOfEmail": null,
130  "HasOptedOutOfFax": null,
131  "DoNotCall": null,
132  "CreatedDate": 1714431097000,
133  "CreatedById": "005ZL000000M0x1YAC",
134  "LastModifiedDate": 1714431097000,
135  "LastModifiedById": "005ZL000000M0x1YAC",
136  "LastCURequestDate": null,
137  "LastCUUpdateDate": null,
138  "EmailBouncedReason": null,
139  "EmailBouncedDate": null,
140  "Jigsaw": null,
141  "JigsawContactId": null,
142  "IndividualId": null,
143  "Pronouns": null,
144  "GenderIdentity": null,
145  "CustomContactField__c": "ABC"
146}