ABSYZ ABSYZ

  • Home

    Home

  • About us

    Who We Are

  • Our Expertise

    What we Do

  • Our Approach

    How We Do It

  • Products

    What We Made

  • Industries

    Who We Do It For

  • Clients

    Whom We Did It For.

  • Article & Blogs

    What Experts Think

  • Careers

    Join The Team

  • Get In Touch

    Let’s Get Started

ABSYZ

PLATFORM EVENTS IN SALESFORCE

Home / Article & Blogs / Salesforce / Integration / PLATFORM EVENTS IN SALESFORCE
By Harshita Kvr inIntegration, Salesforce
Salesforce platform events

In Salesforce we use platform events to connect business processes within the salesforce and the external apps through exchange of real-time event data. Platform Events are secure and scalable messages that contain data.

Platform Events is based on EVENT-DRIVEN-ARCHITECTURE that enables an application to detect “Events” or important business moments and act on them in real time. Publishers publish event messages that subscribers receive in real time.
Salesforce event-driven architecture is consisting of

  • Event Producers
  • Event Consumers
  • Channels.

platform events

Terminology

Event

A change in state that is meaningful in a business process. For instance, a placement  of an order is a meaningful event because the order fulfillment center requires notification to process the order.

Event Notifier

A message that contains data about the event. Also known as an event notification.

Event Producer

The publisher of an event message over a channel.

Channel

A conduit in which an event producer transmits a message. Event consumers subscribe to the channel to receive messages.

Event Consumer

A subscriber to a channel that receives messages from the channel.

Defining Objects and Fields in Platform Events: 

Platform Events can be created just like the custom objects. The biggest difference between platform events and custom object is suffix name for the API name. In platform events, its API name suffix with __e where the custom object appends __c suffix to create API name. Unlike with custom objects, we cannot update or delete event record, or view event records in Salesforce User Interface.

Platform Events support only following custom fields type,

  • Checkbox
  • Date
  • Date/Time
  • Number
  • Text
  • Text Area (Long)

ReplayID System Field and Event Retention

  1. Salesforce stores platform events for 24 hours. In addition you can retrieve stored events in API clients but not in Apex.
  2. Each event record contains a field called ReplayID, which is populated by system after the event is published.
  3. Each ReplayID is guaranteed to be higher than the ID of the previous event, but not necessarily contiguous for consecutive events.
  4. You can retrieve all stored events, or you can specify the ReplayID of an event as the baseline for the retrieved portion of events.

Steps to Create Platform Events:

1. Go to setup, search for platform events in quick find.

platform events

2. To create a new platform event, you need to click on the New Platform Event Button.

platform events

3. Start filling the Platform Event Details. The details would include points like Label, Description and Publish Behavior. The API name of Platform Event would have a postfix with __e, which shows that it’s an event object. Publish Behavior is of 2 types

     a) Publish Immediately-

  • It don’t respect transaction boundaries & can’t be rolled back.
  • Event will be published even if the transaction is failed.
  • It can be used for logging purpose which is intended for transaction.

      b) Publish After Commit–

  • Published only after transaction commits.
  • If transaction commit then only event published. Moreover if any error occur then event is not published.
  • Transactional and can be rolled back.
  • Define event with this option when you are sure that transaction will commit.

platform events

4. Create custom fields for the defined platform event.

platform events

Ways to Publish/Subscribe Platform Events in Salesforce:
Ways to Publishing:

1. Process Builder

2. Flows

3. Apex

4. API ( REST/SOAP)

Steps to Publish the Platform Event through Flow Builder

1. Go to setup, search for flows in quick find. Click on New Flow.

platform events

2. Select the Screen Flow, drag and drop the required fields for creating a form to get information from end user through which you can publish the data for creating an Employee record.

platform events

platform events

3. Add a Create Record element then choose the created platform event object(Job Search) and map the custom fields with the end user input. Once the platform event record gets created, the event messages are transferred through the Event Channel.

platform events

4. Finally connect the elements, save and activate the Flow.

platform events

Ways to Subscribing: 

1. Process Builder

2. Flows

3. Apex Trigger

4. CometD

Steps to Subscribe to the Platform Event through Flow Builder

1. Create a new flow and select Platform Event-Triggered Flow.

platform events

2. Choose respective platform event object(Job Search) to subscribe in the Start element.

platform events

3. Add a Create Record element then choose the created Salesforce object(Employee) and map the custom fields with with published platform event field values(Job Search).

platform events

4. Add an Action Element and choose Email from the category to send an Email notification to the respective end user.

platform events

platform events

5. Finally connect the elements, save and activate the Flow.

platform events

Collecting the input data from end user using Screen Flow

From the Screen we get the inputs from the user. While running the flow, it shows the screen to get the real-time data from the user and based on the input the platform event gets published and  in this scenario a record of Employee Object is created.

Platform Events

Platform Events

Store the input and send an email using Platform Event-Triggered Flow

By using the Platform Event-Triggered Flow, we can get and store the information in Salesforce. The Action element in flows has an option to send an email to the user based on the published input. In addition, we can optionally use the event messages in the email template subject and body as merge fields.

Platform Events

Conclusion:

In conclusion, the Platform Events are quite secured as well as scalable and one can easily define various fields to personalize the platform event data.

Platform Events are an important part of Salesforce’s enterprise messaging platform. The platform events which is an event-driven messaging architecture that would help in enabling the apps to communicate well, both inside as well as outside of Salesforce.

Integration with SalesforcePlatform EventSalesforce
114
Like this post
1 Post
Harshita Kvr

Search Posts

Archives

Categories

Recent posts

BioAsia 2023 in Hyderabad: An Annual International Event

BioAsia 2023 in Hyderabad: An Annual International Event

The Role Of Marketing in Small & Medium Enterprises

The Role Of Marketing in Small & Medium Enterprises

Salesforce For Retail: How Salesforce CRM Can Help Retailers

Salesforce For Retail: How Salesforce CRM Can Help Retailers

What is ChatGPT & How Does It Work?

What is ChatGPT & How Does It Work?

What Is Graphic Design? (Executive Summary 2023)

What Is Graphic Design? (Executive Summary 2023)

  • Future of Remote work - ABSYZ perspective
    Previous PostFuture of Remote work - ABSYZ perspective
  • Next PostIntroduction to Field Service Lightning [now known as Salesforce Field Service (SFS)]
    Future of Remote work - ABSYZ perspective

Related Posts

Salesforce For Retail: How Salesforce CRM Can Help Retailers
Salesforce

Salesforce For Retail: How Salesforce CRM Can Help Retailers

Introduction To Copado Devops Tool
Salesforce

Introduction To Copado Devops Tool

What is Salesforce Code Builder?
Salesforce

What is Salesforce Code Builder?

Automation in Healthcare And Its Benefits
Health Cloud Salesforce

Automation in Healthcare And Its Benefits

Leave a Reply (Cancel reply)

Your email address will not be published. Required fields are marked *

*
*

ABSYZ Logo

INDIA | USA | UAE

  • About us
  • Article & Blogs
  • Careers
  • Get In Touch
  • Our Expertise
  • Our Approach
  • Products
  • Industries
  • Clients
  • White Papers

Copyright ©2022 Absyz Inc. All Rights Reserved.

youngsoft
Copy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “ACCEPT ALL”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent. Privacy Policy
Cookie SettingsREJECT ALLACCEPT ALL
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

SAVE & ACCEPT