Permalink
Switch branches/tags
Nothing to show
Find file Copy path
7bc49db Aug 25, 2018
1 contributor

Users who have contributed to this file

16 lines (14 sloc) 523 Bytes
public class PlatformEventsDemo {
public static void PublishDemoEvent(String message)
{
Demo_Event__e event = new Demo_Event__e(Message__c=message);
Database.SaveResult result = EventBus.publish(event);
if (!result.isSuccess()) {
for (Database.Error error : result.getErrors()) {
System.debug('Error returned: ' +
error.getStatusCode() +' - '+
error.getMessage());
}
}
}
}