Salesforce Platform Events, Change Data Capture, Real-Time Event Monitoring explained

Below details the different Salesforce events types for different use cases

1. Change Data Capture

Select the entities that generate change event notifications. Change Data Capture sends notifications for created, updated, deleted, and undeleted records. All custom objects and a subset of standard objects are supported.

/data/AccountChangeEvent – any changes to accounts

  • Create account
 INFO  c.g.g.s.s.SalesforcePlatformEventHandler - {"LastModifiedDate":"2020-05-11T19:32:35.000Z","CleanStatus":"Pending","OwnerId":"0054P000009tuVoQAI","CreatedById":"0054P000009tuVoQAI","Match_Billing_Address__c":false,"ChangeEventHeader":{"commitNumber":10834564859700,"commitUser":"0054P000009tuVoQAI","sequenceNumber":1,"entityName":"Account","changeType":"CREATE","changedFields":[],"changeOrigin":"","transactionKey":"00031938-a4a4-1f2e-d772-c2527e20cff6","commitTimestamp":1589225555000,"recordIds":["0014P00002lJ0ltQAC"]},"CreatedDate":"2020-05-11T19:32:35.000Z","LastModifiedById":"0054P000009tuVoQAI","Name":"Account Event","Total_Assets__c":0.0}
  • Update account name
c.g.g.s.s.SalesforcePlatformEventHandler - {"LastModifiedDate":"2020-05-11T19:33:42.000Z","ChangeEventHeader":{"commitNumber":10834565354322,"commitUser":"0054P000009tuVoQAI","sequenceNumber":1,"entityName":"Account","changeType":"UPDATE","changedFields":["Name","LastModifiedDate"],"changeOrigin":"","transactionKey":"000320f7-ff66-5c6d-e66d-540dc1dba750","commitTimestamp":1589225622000,"recordIds":["0014P00002lJ0ltQAC"]},"Name":"Account Event123"}
  • Delete account
INFO  c.g.g.s.s.SalesforcePlatformEventHandler - {"ChangeEventHeader":{"commitNumber":10834566118523,"commitUser":"0054P000009tuVoQAI","sequenceNumber":1,"entityName":"Account","changeType":"DELETE","changedFields":[],"changeOrigin":"","transactionKey":"000273af-397f-c5ce-b95a-412eb6071ee2","commitTimestamp":1589225728000,"recordIds":["0014P00002lJ0ltQAC"]}}

2. Real-Time Event Monitoring

Real-Time Event Monitoring helps you monitor and detect standard events in Salesforce in near real-time. You can store the event data for auditing or reporting purposes.

/event/LoginEventStream – LoginEventStream tracks login activity of users who log in to Salesforce. This object is available in API version 46.0 and later.

c.g.g.s.s.SalesforcePlatformEventHandler - {"EventDate":"2020-05-11T22:25:59.000Z","CountryIso":"US","Platform":"Unknown","EvaluationTime":0.0,"CipherSuite":"ECDHE-RSA-AES256-GCM-SHA384","PostalCode":"20149","ClientVersion":"N/A","LoginGeoId":"04F4P00008ybrGk","LoginUrl":"login.salesforce.com","LoginHistoryId":"0Ya4P0000DF17laSQB","CreatedById":"0054P000009y5URQAY","ApiType":"N/A","LoginType":"Remote Access 2.0","Status":"Success","AdditionalInfo":"{}","ApiVersion":"N/A","EventIdentifier":"46f6deba-e3de-4b07-b294-3ed56736da36","LoginLatitude":39.0481,"City":"Ashburn","Subdivision":"Virginia","NetworkId":"000000000000000","SourceIp":"34.230.66.105","Username":"blah@gmail.com","UserId":"0054P000009tuVoQAI","CreatedDate":"2020-05-11T22:26:05.711Z","Country":"United States","LoginLongitude":-77.4728,"TlsProtocol":"TLS 1.2","LoginKey":"LlUdqQsfSrgiRTDY","Application":"Event App","UserType":"Standard","HttpMethod":"POST","SessionLevel":"STANDARD","Browser":"Unknown"}

/event/ApiEventStream – Tracks these user-initiated read-only API calls: query(), queryMore(), and count()

[HttpClient@771a660-23] INFO  c.g.g.s.s.SalesforcePlatformEventHandler - {"EventDate":"2020-05-11T22:28:34.000Z","Platform":"iOS/Mac","Query":"select AccountNumber, AccountSource, Active__c, AnnualRevenue, BillingAddress, BillingGeocodeAccuracy, ChannelProgramLevelName, ChannelProgramName, CleanStatus, CreatedById, CreatedDate, CustomerPriority__c, DandbCompanyId, Description, DunsNumber, Fax, Id, Industry, IsCustomerPortal, IsDeleted, IsPartner, Jigsaw, JigsawCompanyId, LastActivityDate, LastModifiedById, LastModifiedDate, LastReferencedDate, LastViewedDate, MasterRecordId, Match_Billing_Address__c, NaicsCode, NaicsDesc, Name, Number_of_Contacts__c, NumberOfEmployees, NumberofLocations__c, OwnerId, Ownership, Ownership_Check__c, ParentId, Phone, PhotoUrl, Rating, ShippingAddress, ShippingGeocodeAccuracy, Sic, SicDesc, Site, SLA__c, SLAExpirationDate__c, SLASerialNumber__c, SystemModstamp, TickerSymbol, Total_Assets__c, Tradestyle, Type, UpsellOpportunity__c, Website, YearStarted from Account limit 1","EvaluationTime":0.0,"ElapsedTime":51,"Operation":"Query","LoginHistoryId":"0Ya4P0000DF17dtSQB","CreatedById":"0054P000009y5URQAY","SessionKey":"do1y6L0Hc/MNQPEU","ApiType":"SOAP Partner","UserAgent":"SoqlXplorer/3.3 CFNetwork/902.6 Darwin/17.7.0 (x86_64)","Client":"SoqlXplorer/3.3","Records":"{\"totalSize\":1,\"done\":true,\"records\":[{\"attributes\":{\"type\":\"Account\"},\"Id\":\"0014P00002gqPpcQAE\"}]}","AdditionalInfo":"{}","ApiVersion":47.0,"EventIdentifier":"f91c687b-91ab-4c11-8235-d4db95eeb7cc","RowsProcessed":1.0,"SourceIp":"69.181.110.193","Username":"thysmichels@gmail.com","UserId":"0054P000009tuVoQAI","CreatedDate":"2020-05-11T22:28:38.217Z","LoginKey":"PsOEa5SkbjVf4QBC","Application":"N/A","QueriedEntities":"Account","SessionLevel":"STANDARD"}

3. Custom Platform Events

/event/ESBBus__e – custom event bus messages published via Apex: EventBus.publish()

[HttpClient@51c668e3-20] INFO  c.g.g.s.s.SalesforcePlatformEventHandler - {"Name__c":"Test","CreatedById":"0054P000009tuVoQAI","CreatedDate":"2020-05-12T02:39:33.955Z"}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: