ADVANCED-ADMINISTRATOR practice question 10 of 30

An administrator has created a flow that sends platform events whenever an opportunity is updated. An Apex developer has been tasked to write code that listens for these events. When reviewing the debug logs for a user, the developer can see that the flow ran, but the debug Information is missing. What should the administrator recommend to assist with debugging?

Full set: 222 questions
Answer options
A: Select the Debug Enabled checkbox on platform events,
B: Platform events are unavailable for debugging.
C: Set a debug log on the Automated Process entity. Correct answer
D: Search the AppExchange to And a tool that assists with debugging.
Correct Answer:
C. Set a debug log on the Automated Process entity.
Explanation

Apex triggers that subscribe to platform events run asynchronously in a separate transaction under the Automated Process system user. They do not run in the context of the user who caused the event to be published. Therefore, to capture the debug logs for the Apex code that is listening for the event, a debug log trace flag must be set specifically for the Automated Process entity. This will enable the system to generate logs for the subscriber's execution, which can then be reviewed for debugging purposes.

Why Incorrect

A. Select the Debug Enabled checkbox on platform events, This is incorrect because there is no "Debug Enabled" checkbox on the platform event definition itself. Debugging is controlled via trace flags, not object-level settings.
B. Platform events are unavailable for debugging. This is incorrect. While the debugging process is different from standard user-initiated transactions, platform event triggers are fully debuggable by setting a trace flag on the correct entity.
D. Search the AppExchange to And a tool that assists with debugging. This is not the standard or recommended approach. Salesforce provides native tools for debugging, and relying on an external tool is unnecessary for this common scenario.

References

1. Salesforce Apex Developer Guide: In the "Set Up Debug Logging" section, it specifies the procedure for debugging platform event triggers. It states, "To debug platform event triggers, set a trace flag and debug levels in the Developer Console for the Automated Process entity." (See the subsection "Setting Up Debugging in the Developer Console").

2. Salesforce Platform Events Developer Guide: In the "Platform Event Triggers" chapter, under the "Platform Event Trigger and Process Considerations" section, it clarifies the execution context: "Platform event triggers run under the Automated Process system user." This confirms why the debug log must be set for this specific entity.

Scroll to Top