Skip to content

PlatformEventRecipes

pozil edited this page Aug 8, 2023 · 16 revisions

layout: default

PlatformEventRecipes

Demonstrates how to publish events on the event bus

Group Platform Event Recipes

See PlatformEventTriggerHandler

See TriggerHandler

Methods

public static publishEvent(Event_Recipes_Demo__e event)

publishes a platform event

Parameters

Param Description
event an Event_Recipes_Demo__e object

Returns

Type Description
Database Database.SaveResult

Example

Account acct = new Account(name = 'Awesome Events Ltd.');
insert acct;
Event_Recipes_Demo__e evt = new Event_Recipes_Demo__e(accountId__c = acct.id, title__c='Updated website', url__c = 'https://developer.salesforce.com');
Database.saveResults result = PlatformEventsRecipes.publishEvent(evt);
System.debug(result);

Classes

PlatformEventRecipesException

Internal custom exception class

Inheritance

PlatformEventRecipesException


Clone this wiki locally