Newer Version Available

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

Example: Delivered Enriched Event Messages

Check out example event messages that contain enriched fields for update and delete operations.

This change event for an account update includes these enriched fields: the External_Account_ID__c custom field, BillingAddress, and Industry. The changedFields field indicates which fields changed. In this example, only the Fax field and the LastModifiedDate system field changed, but the field values for External_Account_ID__c, BillingAddress, and Industry are also included because they’re enriched fields.

1{
2  "ChangeEventHeader": {
3    "entityName": "Account",
4    "recordIds": [
5      "001ZM000001QkdOYAS"
6    ],
7    "changeType": "UPDATE",
8    "changeOrigin": "com/salesforce/api/soap/61.0;client=SfdcInternalAPI/",
9    "transactionKey": "00097360-44a0-7c2e-a172-97381ae22f82",
10    "sequenceNumber": 1,
11    "commitTimestamp": 1714172795000,
12    "commitNumber": 72657170033,
13    "commitUser": "005ZM000000M6o1YAC",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": [
17      "0x400080"
18    ]
19  },
20  "Name": null,
21  "Type": null,
22  "ParentId": null,
23  "BillingAddress": {
24    "Street": "415 Mission Street",
25    "City": "San Francisco",
26    "State": "CA",
27    "PostalCode": "94105",
28    "Country": "United States",
29    "Latitude": null,
30    "Longitude": null,
31    "GeocodeAccuracy": null
32  },
33  "ShippingAddress": null,
34  "Phone": null,
35  "Fax": "4155551212",
36  "AccountNumber": null,
37  "Website": null,
38  "Sic": null,
39  "Industry": "Biotechnology",
40  "AnnualRevenue": null,
41  "NumberOfEmployees": null,
42  "Ownership": null,
43  "TickerSymbol": null,
44  "Description": null,
45  "Rating": null,
46  "Site": null,
47  "OwnerId": null,
48  "CreatedDate": null,
49  "CreatedById": null,
50  "LastModifiedDate": 1714172795000,
51  "LastModifiedById": null,
52  "Jigsaw": null,
53  "JigsawCompanyId": null,
54  "AccountSource": null,
55  "SicDesc": null,
56  "External_Account_ID__c": "1ABC"
57}

After being decoded in a Pub/Sub API client, the changedFields field lists the fields changed, including the Fax field.

12024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class - ============================
22024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class -        Changed Fields       
32024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class - ============================
42024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class - Fax
52024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class - LastModifiedDate
62024-04-26 16:15:52,375 [grpc-default-executor-0] java.lang.Class - ============================

A change event message for a delete operation includes the enriched fields, External_Account_ID__c, BillingAddress, and Industry.

1{
2  "ChangeEventHeader": {
3    "entityName": "Account",
4    "recordIds": [
5      "001ZM000001QkdOYAS"
6    ],
7    "changeType": "DELETE",
8    "changeOrigin": "com/salesforce/api/soap/61.0;client=SfdcInternalAPI/",
9    "transactionKey": "00097379-d9df-704f-ed2f-c1d2ca3ac266",
10    "sequenceNumber": 1,
11    "commitTimestamp": 1714172911000,
12    "commitNumber": 72657195312,
13    "commitUser": "005ZM000000M6o1YAC",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": []
17  },
18  "Name": null,
19  "Type": null,
20  "ParentId": null,
21  "BillingAddress": {
22    "Street": "415 Mission Street",
23    "City": "San Francisco",
24    "State": "CA",
25    "PostalCode": "94105",
26    "Country": "United States",
27    "Latitude": null,
28    "Longitude": null,
29    "GeocodeAccuracy": null
30  },
31  "ShippingAddress": null,
32  "Phone": null,
33  "Fax": null,
34  "AccountNumber": null,
35  "Website": null,
36  "Sic": null,
37  "Industry": "Biotechnology",
38  "AnnualRevenue": null,
39  "NumberOfEmployees": null,
40  "Ownership": null,
41  "TickerSymbol": null,
42  "Description": null,
43  "Rating": null,
44  "Site": null,
45  "OwnerId": null,
46  "CreatedDate": null,
47  "CreatedById": null,
48  "LastModifiedDate": null,
49  "LastModifiedById": null,
50  "Jigsaw": null,
51  "JigsawCompanyId": null,
52  "AccountSource": null,
53  "SicDesc": null,
54  "External_Account_ID__c": "1ABC"
55}