The Stack Overflow podcast is back! Listen to an interview with our new CEO.
24

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 ...


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 ...


14

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, ...


13

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 ...


12

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 ...


12

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

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 ...


10

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.


10

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 ...


8

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 ...


7

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 ...


7

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 { @...


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

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

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 ...


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

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:


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


6

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 ...


6

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.


5

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 ...


5

Answer: Salesforce bug Workaround: Create a trigger for your platform events. I reached out to the Official Platform Events community and created a case with Salesforce. This is a Salesforce bug which they are currently working on patching. The reason my unit tests were failing is because I did not have a trigger for the platform event that was being ...


5

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" : "...


5

This post contains multiple questions and is probably too broad but let me try to answer anyway. Overall I would say that using Platform Events (PEs) instead of triggers is not a good approach if you don't intend to integrate with external systems. PEs are meant to facilitate integration with external systems so you defeat its purposes by using it ...


5

As of the Spring '19 release you are now able to monitor Event Delivery through the limits resource via the REST API (stored in the DailyStandardVolumePlatformEvents response) - https://releasenotes.docs.salesforce.com/en-us/spring19/release-notes/rn_messaging_standard_volume_limit.htm To monitor your monthly event delivery usage for High Volume Platform ...


5

Thank goodness we have premier support as within a few hours, I had the stacktrace for the Gack: Internal Salesforce Error: 493985485-49401 (255731747) (255731747) SourceClassName: data.api.event.EventConduitDataSourceConnection SourceMethodName: upsertRows Subject: Sandbox: Sandbox: Error during SoapOperationRunTests at data.api.event....


5

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 ...


5

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


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