Salesforce Certified Platform Developer II free question 8 / 10 · Domain 4: Testing, Debugging, and Deployment
In the Developer Console, a developer wants to put checkpoints on seven lines of an Apex class and inspect the state of objects at each point. Which statement matches the Help documentation?
- Put checkpoints in the Visualforce markup and inspect the page state
- Only one can be enabled at a time, so run the code seven times
- Up to five can be enabled at the same time, so choose the locations again
- There is no limit on checkpoints, so set seven and inspect them at once
Show the answer and explanation
Answer: C
Why this is correct
The "Set Checkpoints in Apex Code" page says to use Developer Console checkpoints to debug your Apex classes and triggers, and that you can't set checkpoints in Visualforce markup. To set one, you open an Apex class or trigger in the Source Code Editor and click the margin to the left of the line number. You can enable up to five checkpoints at the same time.
Why the other options are wrong
"There is no limit on checkpoints, so set seven and inspect them at once" … The page says you can enable up to five checkpoints at the same time, so there is a limit.
"Put checkpoints in the Visualforce markup and inspect the page state" … The page says you can't set checkpoints in Visualforce markup. They are for Apex classes and triggers.
"Only one can be enabled at a time, so run the code seven times" … The page says up to five checkpoints can be enabled at the same time, not one.
Requirements and cleanup
Setting checkpoints requires the View All Data user permission. To generate results, run code using execute anonymous, or set a DEVELOPER_LOG trace flag on yourself. Checkpoints persist until you click Debug | Clear Checkpoint Locations.