Skip to content

PlatformEventRecipes

codefriar edited this page Oct 19, 2020 · 16 revisions

layout: default

PlatformEventRecipes class

Demonstrates how to publish events on the event bus

Related

PlatformEventTriggerHandler, TriggerHandler


Methods

publishEvent(Event_Recipes_Demo__e event)Database.SaveResult

publishes a platform event

Parameters

Param Description
event an Event_Recipes_Demo__e object

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:
Database.saveResults result = PlatformEventsRecipes.publishEvent(evt);
System.debug(result);

Inner Classes

PlatformEventRecipes.PlatformEventRecipesException class

Internal custom exception class


Clone this wiki locally