Salesforce
PDII · Question #378
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 Eventbus.publish() method.
- BPublish the error event with a Flow.
- CPublish the error event using the addError() method.
- DNo publishing is necessary. Have the external system subscribe to the BatchApexErrorEvent.
How the community answered
(45 responses)- A4% (2)
- B7% (3)
- C18% (8)
- D71% (32)
Community Discussion
No community discussion yet for this question.