Question: Subscribe to a Platform Event in an Apex trigger Your Salesforce app uses an Apex trigger to listen to events. Once your app receives the
Subscribe to a Platform Event in an Apex trigger
Your Salesforce app uses an Apex trigger to listen to events. Once your app receives the notification from the order system through the Apex trigger, it creates a task to follow up on the order shipment.
Create an Apex trigger for OrderEvente:
Name: OrderEventTriggerThis Apex trigger should be similar to the CloudNewsTrigger Apex trigger, but operates on the OrderEvente event and creates tasks instead of cases.
If the order has shipped eventHasShippedc true create a task with the following values:
Priority: 'Medium'Subject: 'Follow up on shipped order 'OwnerId: event.CreatedByIdNote: You are assigning the task OwnerId to the same user who published the event. This step keeps things simple so you don't have to perform any prerequisites.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
