Blog Blog Posts Business Management Process Analysis

Salesforce Platform Events

Salesforce has a unique way to approach different customers. Salesforce allows the admin of a company to broadcast any particular message to various other terminals. For example, if a manager wants to send a message to every employee in the organization then platform events can be used to perform this task.

Meanwhile, check out our YouTube video on Salesforce Tutorial

 

What are Salesforce Platform Events?

A PlatformEvent is a special type of Salesforce entity that is similar to Salesforce custom objects. You can create a platform event definition and then add custom fields in custom objects.

The events get sent to the user anyway whether the user acknowledges it or not. Platform events are the event messages or notifications that your apps send and receive to take further actions. It simplifies the process of communicating changes and responding to them without writing complex logic.

Publishers and subscribers communicate with each other through these events. One or more subscribers could listen to the same events and carry out the actions required to perform.

 

Challenges faced in Point-to-Point Integrations

Before the usage of Salesforce platform events, the other applications were connected by point-to-point integration methods. But there are many challenges faced by people while using point-to-point integration methods and thus, it leads to big problems in the organization. Some of the limitations of point-to-point integration methods are-

The solution to these problems is the adoption of Event-Driven Architecture

 

What is Event-Driven Architecture in Salesforce?

Event-Driven Architecture is the brand new manner of enforcing enterprise common sense via leveraging High Volume Platform Event. The Event-Driven Architecture is likewise referred to as a publisher/subscriber version in which the publishers and the subscribers don’t recognize every difference and might co-exist independently. Also, the main factor of Event-Driven Architecture is that there is a single channel which deals with all the communication thus, maintaining the data integrity of the organization. The communication between the writer and the subscriber is set up through a subscription channel.

In that manner, every entity is absolutely unbiased of becoming a member or leaving the subscription channel. Because of the loose coupling nature, it is also simpler for the developer to broaden every issue independently.

When a publisher publishes an event it goes to the Event Bus and is available for subscription through a subscription channel and can pass on to the subscribers who already subscribe to the corresponding channel.

Salesforce Platform Events allow the application of Event-Driven Architecture thus, helping integrate different apps together. Salesforce events get integrated with third-party applications. The internal Salesforce apps can be considered as publishers or subscribers or the third-party apps can also be considered as publishers or subscribers.

Learn Salesforce from the scratch with Intellipaat’s Salesforce Tutorial!

 

Use of Platform Events in Salesforce

Here is a list of uses of Platform Events in Salesforce-

The messages sent by the admin as notifications have a particular limit. The maximum event message size that you can publish is 1 MB. If your event object has hundreds of custom fields or many long text area fields, you could hit this limit. In this case, the publishing call gets an error.

 

Use Cases of Platform events in Salesforce

Salesforce and external systems communicate through platform event messages. Some Use Cases are-

 

How to publish Platform Events in Salesforce?

After a platform event has been defined in your Salesforce org, Publish Event messages from a Salesforce app using processes, flows, or Apex or an external app using Salesforce APIs.

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.

Want to learn Salesforce right from scratch, enroll yourself in our Salesforce Certification Training now!

 

How to Define Platform Events? 

Preparing for a Salesforce job? check out our list of Salesforce Interview Questions and Answers and ace your Salesforce job interview.

 

How to Add a Field to the Platform Event

  1. On the Notification platform event page, click New in Custom Fields & Relationships.
  2. Select Text as the field data type
  3. Click Next
  4. Set the following values:
    • Field Label: Message
    • Length: 255
    • Field Name: Message
    • Description: The notification message
    • Required: Check the box next to “Always require a value in this field in order to save a record”.
    • Click Save
Become a Salesforce Administrator and App Builder

Examples of Platform Events in Salesforce

Here is a list of examples where a platform event is used-

To access the sample code on GitHub, check out The Pure Aloe App.

Have any more queries regarding Salesforce Developer Jobs, Join our Salesforce Community page and get your queries answered.

The post Salesforce Platform Events appeared first on Intellipaat Blog.

Blog: Intellipaat - Blog

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/salesforce-platform-events/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×