Last active
October 9, 2018 02:21
-
-
Save tsmalara/5491c5164e0bfdeeaff2a079c4aa7ab1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmpApi_exampleController { | |
@AuraEnabled | |
public static void publishEvent() | |
{ | |
System.debug('Published Event!'); | |
Demo_EmpApi_Event__e event = new Demo_EmpApi_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()); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment