28

From Christopher Marzilli via twitter: when you go into setup to create a new trace you should see an option for "Traced Entity Type" select Automated Process. It appears that Summer '17 has added a new type of TraceFlag. To get them to appear in the Developer Console you will also need to uncheck "Show My Current Logs Only". Additionally, it appears ...


18

Other answers have shown that it's not supported to query events using SOQL, but I want to clarify that it's not only not supported, it is not meaningful. Platform events form an ordered time stream. Each event has a specific "replay ID", and each event's replay ID is higher (not necessarily 1 higher, but higher) than the previous event's. They're ...


16

Turns out that you have to actually go into the sandbox (just refreshed from PROD) and recompile the subscribing trigger for SFDC to recognize it as available to the Platform Event subsystem. In a way, this is like the use case wherein Schedulable classes are not available in the Force.com UI Schedule Apex Classes unless you recompile that class and/or run ...


16

UPDATE I have also discussed this topic with some more detail on on my blog here. Based on your requirements where: External System will push data in Salesforce. My recommendation is to construct REST APIs for this purpose which the External Systems can utilize to send data to Salesforce. Platform Events are more targeted towards a Pub/Sub model, ...


15

Are the subscription triggers processed synchronously or asynchronously? Aynchronously Do the subscription triggers get separate limits from the publishing context? Yes, separate limits from the publishing context If the limits are separate, does each subscription trigger get its own set? Each Apex subscription trigger executes in its own ...


14

Very generally, the Streaming API was created primarily to update UI components(Source) where as Platform Events are for integrations via a Message Bus. With a PushTopic from the Streaming API you are limited to receiving events notifications when the configured query and event occur. There is no capacity to manually generate these events beyond causing the ...


12

Another significant differences - In streaming API's we lose the update (event) if the subscriber is offline, however in platform events they will be available in the event bus for a duration of 24 hours. So if a subscriber comes online after sometime, he will still have access to updates happened during outage time. [Update] Same can be achieved for ...


12

The Platform Event feature was introduced very recently. Any time you are making use of such a new feature, make sure you set the API Version to the most up to date value available.


12

How about option 3: Wait a week. According to the release notes, EmpApi is currently slated to go live in LWC for Summer 19.


12

Maximum size allowed is 1048576 bytes (1.05MB) When you exceed the limit, you will get below message: (Database.Error[getFields=();getMessage=The event payload size of 1179064 bytes exceeds the maximum allowed size of 1048576 bytes;getStatusCode=PAYLOAD_SIZE_EXCEEDED;]) TESTING: Create a platform event POC_PE__e and create 9 long text fields and use ...


11

What could cause a creation of a platform event to fail? You can actually find this on Platform Event Error Status Codes which lists down the reasons for the failures. And it seems there are primarily only two of such scenarios where it could fail. LIMIT_EXCEEDED The number of published platform event messages exceeded the hourly publishing limit or the ...


10

So as I can see from your code Divide by zero will throw an exception. Which inturn will fire BatchApexErrorEvent . The thing we need to look for is this is the test context. The events will not deliver unless you force it to deliver. Thus you have to call Test.getEventBus().deliver();, this will ensure your triggers on platform events are fired and you can ...


9

Is it smart to create events like CaseInserted__e for all the possible objects i need to track, or is is smarter to have a general SObjectInserted__e event? Generally, use one event for each unique type of event. Even though you're just using them in triggers right now, eventually you might decide to integrate with other systems, and they might only want ...


8

My colleague suggested the following solution. Events can be stacked in static property and then checked in assert. So trigger can be refactored like following trigger CustomObject on CustomObject__c (after update) { CustomObjectService.publishEvent(); } and method can be extracted into service class public class CustomObjectService { @...


8

Generally I wouldn't recommend it as a way of preforming delayed asynchronous processing that would otherwise be handled by future or queueable methods. That's just me thou and your extenuating circumstances may be different than mine. A few reasons spring to mind for why this might not be a good idea. The Apex Trigger for the event is still a trigger, so ...


8

The replication API is designed to have synchronization windows of at least five minutes, so would not be suitable for synchronization of shorter periods. Most ETL tools also don't support windows of less than five minutes, since they tend to use the replication API or SOAP API. ETL stands for "Extract-Translate-Load". There's nothing in there about ...


7

lightning:empApi is not supposed to work using VF page/Lightning out. If you see the Experience section in the documentation of this component, you will find as below. Only those components which has Lightning Out / Visualforce listed in the Experience section will work in that experience. Experience Lightning Experience, Salesforce Mobile App


7

Change Data Capture : Receive near-real-time changes of Salesforce records, and synchronize corresponding records in an external data store. Change Data Capture publishes data change events, which represent changes to Salesforce records. Changes include creation of a new record, updates to an existing record, deletion of a record, and undeletion of a record. ...


7

Per documentation, lightning:empApi is not supported in Communities. If you refer to the Experience section in the documentation, the only supported experiences are LEX and Mobile. Refer screenshot from the documentation:


7

The code/transaction run by a Platform Event Trigger is run as the "Automated Process" User, and won't show up in logs unless you specifically set up a debug log for the "Automated Process" traced entity type.


6

Sounds like a bug. We are looking into this now. Testing was working last week, and it is working in our development environments. More to come... Jay Hurst (Director, Product Management for Enterprise API and Enterprise Messaging at Salesforce) Thanks to everyone for your patience. We identified the issue and are pushing a fix on Tuesday evening/...


6

I'll let you in on a not so well kept secret. You can often troubleshot the Trailhead challenge validation in a developer org. But shh, don't tell anyone! It's really as simple as having the developer console open and actively capturing debug logs when the validation occurs. I reran the validation for this challenge and got the following logs. So ...


6

We had a similar issue pertaining to email. What we found was that emails generated from Workflow were not reaching email addresses (specifically on the Gmail domain). Using the Email Log Files we determined that the sending user for emails sent by the Automated Process user was "rsandoval@ourorgid" with no ".com" appended. This meant that Gmail would ignore ...


6

They are free if you have a sufficiently high enough subscription. From the related help topic: Available in: Performance, Unlimited, Enterprise, and Developer Editions


6

In V42.0, SFDC added a new REST composite collection resource that is bulkified and works with Platform Events! /services/data/v42.0/composite/sobjects { "allOrNone" : false, "records" : [{ "attributes" : {"type" : "Low_Ink__e"}, "Printer_Model__c" : "XZ0-5" }, { "attributes" : {"type" : "Low_Ink__e"}, "Printer_Model__c" : "...


6

My original answer, while useful is not the full story. After an extended discussion on the Platform Events Success Community with the Product Manager, it turns out as a trigger (or for that matter, a Process Builder or Visual Flow) subscriber you have no control over the size of the incoming batch! Per the PM, the subscriber can receive up to 2,000 ...


6

I've checked every documentation on platform events I could find, and the answer is: you can't monitor it without doing the monitoring yourself. You can create a custom object or a custom setting to store the event count, since platform events support after insert triggers. From there, you can determine how many calls were made during a specific day (and ...


6

Update from the Winter '20 release notes: Monitor Platform Event Publishing Usage in REST API The hourly event publishing usage for standard-volume and high-volume platform events is now available in REST API. Use the limits REST resource in your app to monitor your event publishing usage against the two allocations. How: The limits resource ...


6

CDC and Platform Events are really different use cases. Platform Events are a generalized event-driven, publish/subscribe mechanism. You can publish Platform Events to represent record changes (in Apex triggers that you implement), but that's not all it can do, and that use case isn't provided as out-of-the-box Platform Events functionality. You can also,...


6

Based on some sleuthing by @danielballinger I believe that becomes an option in Summer 19 (#safeharbor and all that) PreRelease Orgs are now available if you want to check it out for yourself, or you can wait for Sandbox upgrades to start


Only top voted, non community-wiki answers of a minimum length are eligible