Salesforce
PDII · Question #321
Instead of waiting to send emails to support personnel directly from the finish method of a batch Apex process, Universal Containers wants to notify an external system in the event that an unhandled…
The correct answer is D. No publishing is necessary. Have the external system subscribe to the BatchApexErrorEvent. See the full explanation below for the reasoning.
Question
Instead of waiting to send emails to support personnel directly from the finish method of a batch Apex process, Universal Containers wants to notify an external system in the event that an unhandled exception occurs. What is the appropriate publish/subscribe logic to meet this requirement?
Options
- APublish the error event using the addError() method and write a trigger to subscribe to the event
- BPublish the error event using the addError() method and have the external system subscribe to the
- CPublish the error event using the Eventbus.publish() method and have the external system
- DNo publishing is necessary. Have the external system subscribe to the BatchApexErrorEvent.
How the community answered
(20 responses)- A5% (1)
- B15% (3)
- C5% (1)
- D75% (15)
Community Discussion
No community discussion yet for this question.