
From your Setup, in quick find box search for “Platform Events” then click on “New Platform Event” then just like your Custom Object enter the label and API name for your Platform Event. Once completed then add any Custom Fields you want.
How do I query eventlogfile in Salesforce?
In the Filter the repository field, type EventLogFile. Select EventLogFile under Entities. Click Open. Next, select the fields for your query and click the Query button. Before proceeding to the next step, check to make sure event data is present in your org.
How do I run a query in Salesforce?
Click Open. Next, select the fields for your query and click the Query button. Before proceeding to the next step, check to make sure event data is present in your org. If there isn’t data, run and export at least one report and wait 24 hours for the data to appear.
What is a platform event in Salesforce?
Consider this, a platform event is just like another custom object but this would only be referred by external systems to communicate with Salesforce. To put this in a scenario when a certain system posts data on a Salesforce endpoint then that data should be fetched and the data in Salesforce should be updated.
Where can I find every event type in Salesforce?
Every event type is documented in the Salesforce Object Reference. In it, you can see the fields and their descriptions, and sample queries to use.
See more

Can I query platform event Salesforce?
For platform events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query. For change data capture events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query.
How do I see platform event status in Salesforce?
To get notified of the status of event publish operations, enable status events on your high-volume platform event. Then subscribe to the PublishStatusEvent standard platform event with Apex triggers or CometD clients.
How do I use platform events in Salesforce?
Define a Platform EventFrom Setup, enter Platform Events in the Quick Find box, then select Platform Events.On the Platform Events page, click New Platform Event.Create a Notification platform event with the following settings: Label: Notification. Plural Label: Notifications. Object Name: Notification. ... Click Save.
How do I add a platform event record in Salesforce?
Subscribing Platform Events Apex Trigger : Write an “after insert” Apex trigger on the event object to subscribe to incoming events. Triggers receive event notifications from various sources—whether they're published through Apex or APIs. In an external app, you subscribe to events using CometD as well.
What is platform event message in Salesforce?
A platform event is a special kind of Salesforce entity, similar in many ways to an sObject. An event message is an instance of a platform event, similar to how a record is an instance of a custom object. Unlike custom objects, you can't update or delete event records.
How do I trigger a platform event in Salesforce?
To create a platform event trigger, use the Developer Console.Click the Setup icon, select Developer Console, and click File | New | Apex Trigger.Provide a name and choose your event for the sObject, and click Submit.
How can I see platform events records?
View Event Subscribers From Setup, enter Platform Events in the Quick Find box, then select Platform Events. Click your event's name. On the event's definition page, the Subscriptions related list shows all the active triggers, processes, and platform event–triggered flows that are subscribed to the platform event.
What is platform event flow in Salesforce?
Platform Events in Salesforce Platform Event is based on Event-Driven Architecture which enable apps to communicate inside and outside of Salesforce. Platform events are based on the publish/subscribe model and work directly with a message bus which handles the queue of incoming events and processes listening for them.
What is a platform event triggered flow?
Platform Event-Triggered Flow Considerations A flow can receive a batch of event messages at once—a maximum of 2,000 event messages. Debug logs for platform-event triggered flows and resumed flow interviews appear under the Automated Process user.
When platform events are published?
Platform events are scalable and secure messages holding data. The publishers publish the event messages that the subscribers receive in real-time. If one wants to modify the data publishes, he needs to define platform event fields.
How do I call Apex platform event?
To publish event messages, call the EventBus. publish method. For example, if you defined a custom platform event called Low Ink , reference this event type as Low_Ink__e . Next, create instances of this event, and then pass them to the Apex method.
How do I give access to a platform event?
To subscribe to or publish messages to Salesforce custom platform events, you must configure permissions in your Salesforce environment.Log in to Salesforce.Under. Administer. on the left pane, click. Manage Users. ... Edit the profile to assign object permissions to the Salesforce custom platform event that you created.
What happens after a Salesforce upgrade?
After a Salesforce major upgrade, usage data can be inaccurate for the day and the last 24 hours within the upgrade window. New usage data overwrites the data for the hour that the 5-minute upgrade occurs in. The new usage data includes metrics that start after the upgrade for that hour. For more information about Salesforce upgrades, see Salesforce Upgrades and Maintenance in Help and Salesforce Status.
What is the first value in a platform event?
For platform events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query.
How to get usage metrics for last 24 hours?
To get usage metrics for the last 24 hours, ending at the last hour, perform a query by specifying the start and end date and time in UTC, and the metric name. For the last 24-hour period, the end date is the current date in UTC, with the time rounded down to the previous hour. The start date is 24 hours before the end date.
How to get daily usage metrics?
To get daily usage metrics for one or more days, perform a query by specifying the start date and end date in UTC, and metric name.
How to get usage data for cometd?
To get usage data for event publishing and CometD-client delivery, query the PlatformEventUsageMetric object. Usage data is available for the last 24 hours, ending at the last hour, and for historical daily usage. PlatformEventUsageMetric is available in API version 50.0 and later.
What is the first value of change data capture?
For change data capture events, you can query usage data for these metrics. The first value is the metric name value that you supply in the query.
Is usage data available for arbitrary intervals?
Usage data isn’t available for 1-hour intervals or any other arbitrary interval. The only supported intervals are the last 24 hours and daily data. Also, usage data isn’t available for standard-volume platform events.
How long does it take for Salesforce events to appear in log files?
Read along to learn how your admin would take the steps in a production org. You can also follow along using a Trailhead Playground, but it takes 24 hours for events to appear in log files.
What is EventType field in Salesforce?
The EventType field in the EventLogFile object supports events. Every event type is documented in the Salesforce Object Reference. In it, you can see the fields and their descriptions, and sample queries to use.
What is query results grid?
The Query Results grid displays each record as a row. You can open, create, update, and delete records without leaving the Developer Console.
What is an example of a sales rep leaving a company?
Let’s consider an example: A sales rep named Rob Burgle left your company a few weeks ago and joined a major competitor. All of a sudden, you start losing deals to this other company. You suspect that Rob downloaded a report containing confidential lead information and shared it with his new employer.
What is report event?
Report events contain information about what happened when a user ran a report—things like the date and time, the report name, the records referenced in the report, the number of rows and columns, and the originating user, among many others .
How long does it take for event data to appear in a report?
Before proceeding to the next step, check to make sure event data is present in your org. If there isn’t data, run and export at least one report and wait 24 hours for the data to appear.
Can you confirm suspicions with Event Monitoring?
Normally, you wouldn’t be able to confirm your suspicions. But with Event Monitoring, you can gather all the evidence you need to set the story straight. Let’s look at how this process works. It takes only a couple of clicks to open the Developer Console from Lightning Experience.
