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 Order_Event__e:
Name: OrderEventTriggerThis Apex trigger should be similar to the CloudNewsTrigger Apex trigger, but operates on the Order_Event__e event and creates tasks instead of cases.
If the order has shipped (event.Has_Shipped__c == true), create a task with the following values:
Priority: 'Medium'Subject: 'Follow up on shipped order 105'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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!