Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

Publish and subscribe platform events using flows

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Próximo SlideShare
Formstack
Formstack
Cargando en…3
×

Eche un vistazo a continuación

1 de 23 Anuncio

Más Contenido Relacionado

Presentaciones para usted (20)

Similares a Publish and subscribe platform events using flows (20)

Anuncio

Más de KadharBashaJ (20)

Más reciente (20)

Anuncio

Publish and subscribe platform events using flows

  1. 1. Salesforce Admin Group, Trichy Publish and Subscribe Platform events using Flows
  2. 2. Kadhar Basha J Salesforce Admin Group, Trichy Trailblazer Community Group Leader MST Solutions Sundaravel J Salesforce Admin Group, Trichy Trailblazer Community Group Co-Leader MST Solutions Salesforce Admin Group, Trichy
  3. 3. Salesforce Admin Group, Trichy Speaker Jeganathan B MST Solutions
  4. 4. Today’s Agenda • Introduction • How to create Platform Events? • Platform event transactions & Datatypes • Publish and Subscribe to Platform Events • Publish and Subscribe using Flows • Use Cases • Demo
  5. 5. Introduction Logo • Platform event is an Event-Driven architecture and used to connect and exchange the real-time event data in Salesforce and external apps. • Platform events are secure and scalable messages that contain data. • Publishers publish event messages that subscribers receive in real time. • One or more Subscribers can listen to the same published event messages.
  6. 6. Event-driven terminology Logo Event A change in state that is meaningful in a business process Event message A message that contains data about the event. Also known as an event notification
  7. 7. Event-driven terminology Logo Event producer The publisher of an event message Event channel A stream of events on which an event producer sends event messages and event consumers read those messages Event consumer A subscriber to a channel that receives messages from the channel Event bus A communication and storage service that enables event streaming using the publish- subscribe model. The event bus enables the retrieval of stored event messages at any time during the retention window
  8. 8. How to create Platform events? Logo • A platform event is a special kind of Salesforce entity, similar in many ways to a Salesforce object. • An event message is an instance of a platform event, similar to how a record is an instance of a Salesforce object. Transaction Control • Publish After Commit • Publish immediately
  9. 9. Supported Datatypes Logo Datatypes Checkbox Date Date/Time Number Text Text Area (Long)
  10. 10. Sobject vs Platform events Logo Like a Sobject • Create in setup • Allow Custom fields • Can be inserted declaratively or through code • Control Read and Create Permissions Not like a Sobject • Platform Events are ‘definition’ entities • A record is considered as message • Messages are not viewable in the UI • Messages can’t be updated or deleted
  11. 11. Generic Event vs Platform Event Logo
  12. 12. Publish Platform Events Logo After a platform event has been defined in your Salesforce org, publish event messages from a Salesforce app by using, Apex Process builder Flow Salesforce API’s
  13. 13. Subscribe to Platform Events Logo Published event messages can be received by using the following ways, Apex trigger Process builder Flow builder CometD clients(EMP Connector) Lightning Component
  14. 14. Considerations Logo Platform event is appended with __e suffix for API name of the event Can't query Platform events through SOQL or SOSL Can't use Platform events in the reports, list views, and search. Platform events don’t have an associated tab Published platform events can’t be rolled back All platform event fields are read-only by default Only after insert Triggers are supported Platform events accessible through API and declaratively
  15. 15. Inside Salesforce Logo Use Cases • To avoid Mixed DML Exception(Setup and non-setup objects) • Delete the uploaded file as a site guest user(Using record Id) • Collect the input from user through Community
  16. 16. Publish using Flow Logo • Use flows to publish event messages from a Salesforce app as part of some user interaction, an automated process, or workflow action. • Publish using Create record element in flows.
  17. 17. Publish using Screen Flow Logo
  18. 18. Subscribe using Flow Logo • Subscribed flows and interviews can receive event messages published through Apex, APIs, flows, and other processes. • Flow type: Platform event–triggered flow • Use field values from the platform event messages by referencing the $Record global variable ($Record.FieldApiName)
  19. 19. Subscribe using Platform-event triggered Flow Logo
  20. 20. Launch DEMO
  21. 21. Publish through Salesforce API’s Logo Workbench REST endpoint /services/data/v51.0/sobjects/Event_Name__e Request body for a POST request { "fieldname" : "value" }
  22. 22. Any Questions so far

×