INTEGRATION-ARCHITECTURE-DESIGNER practice question 7 of 25

The director of customer service at Northern Trail Outfitters (NTO) wants to capture and trend specific business events that occur in Salesforce in…

Full set: 106 questions

Domain Evaluate the Current System Landscape

The director of customer service at Northern Trail Outfitters (NTO) wants to capture and trend specific business events that occur in Salesforce in real time. The metrics will be accessed in an ad- hoc manner using an external analytics system. The events that are of interest are: A customer has initiated a product exchange via a Case A customer service rep clicks on the "Authorize Exchange Product" menu item on the Case A customer has initiated a subscription cancellation via a Case A customer service rep clicks on the "Initiate Refund" menu item on the Case Which two solutions will meet these business requirements? Choose 2 answers
Answer options
A: Case after insert Trigger that executes a callout.
B: Case Workflow Rule that sends an Outbound Message.
C: Case after insert Trigger that publishes a Platform Event. Correct answer
D: Custom Apex controller that publishes a Platform Event. Correct answer
Correct Answer:
C. Case after insert Trigger that publishes a Platform Event.; D. Custom Apex controller that publishes a Platform Event.
Explanation

This scenario requires capturing two types of business events in real-time: those initiated by record creation (a customer creating a Case) and those initiated by a specific user action (a rep clicking a menu item). Platform Events provide a scalable, decoupled, and real-time mechanism to broadcast these events to external subscribers, such as an analytics system.
- Option C addresses the events triggered by Case creation. An after insert trigger on the Case object is the standard mechanism to execute logic upon record creation, and from this trigger, a Platform Event can be published.
- Option D addresses the events triggered by user interface clicks. A custom menu item would invoke a custom Apex controller, which can then publish the appropriate Platform Event. Combining these two solutions creates a comprehensive and robust event-driven integration.

Why Incorrect

A. Case after insert Trigger that executes a callout. This creates a tightly coupled integration. A synchronous callout in a trigger would cause the user's transaction to wait for the remote system's response and fail if the endpoint is down.
B. Case Workflow Rule that sends an Outbound Message. Outbound Messages are triggered by record creation or updates, not by UI actions like a menu click. This option only solves half of the requirement and is a legacy automation tool. ---

References

1. Platform Event Developer Guide, "Publish Platform Events": This guide details the methods for publishing Platform Events. It explicitly states, "You can publish event messages from Apex... For example, you can publish an event message in an Apex method or a trigger." This directly supports using both a trigger (Option C) and another Apex class like a controller (Option D) to publish events.

2. Apex Developer Guide, "Triggers": The section on "Trigger and Bulk Request Best Practices" implicitly supports using triggers for actions related to record events. The guide also contains a section on "Callouts from Triggers," which warns that callouts must be asynchronous to avoid holding the database connection open, making a direct, synchronous callout (Option A) a poor pattern.

3. Salesforce Integration Patterns and Practices, "Fire and Forget": This official Salesforce whitepaper describes the "Fire and Forget" integration pattern, which is ideal for this use case. It lists Platform Events as a recommended solution for notifying external systems of an event in Salesforce without needing to wait for a response. This validates the architectural choice of Platform Events (Options C and D) over a request-response callout (Option A).

4. Lightning Web Components Developer Guide, "Call Apex Methods": This guide explains how a UI element, such as a custom button or menu item implemented as a Lightning Web Component, can invoke a method in an Apex controller. This is the mechanism that enables the solution described in Option D, where a UI click triggers the publication of a Platform Event via an Apex controller.

Scroll to Top