Newer Version Available
Create an Event with an EventUuid Field
The EventUuid field uniquely identifies an event
message and is used to match the events returned in the callback result with the events in the
publish call. To have the system generate an EventUuid field
value in each event object, use the SObjectType.newSObject(recordTypeId, loadDefaults) Apex method to create the event
object.
1Order_Event__e event = (Order_Event__e)Order_Event__e.sObjectType.newSObject(null, true);
2
3// The EventUuid value is returned after object creation
4System.debug('EventUuid: ' + event.EventUuid);
5
6// Debug output
7// EventUuid: 19bd382e-8964-43de-ac01-d5d82dd0bf78