---
schema_version: "1"
id: 70c6f30c049d43d409e8422ff9f6988054ba48c9b4a32fa85709d352bf809fe6
title: Set Checkpoints in Apex Code
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_dev_console_checkpoints_setting.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_setting.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 20ef57ce5ac5738d3e2d1003a175de25bd248d1e04cb7745bcc3b31c8c79b81e
description: Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.
products:
  - Salesforce Platform
release: "264"
---
# Set Checkpoints in Apex Code

Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_important.png)

Important To set checkpoints, you need the View All Data user permission. To generate results using checkpoints, run code using execute anonymous, or set a DEVELOPER\_LOG trace flag on yourself. The trace flag must have a log level for Apex of INFO or higher.

1. Open the Apex class or trigger in the Source Code Editor.
2. Click in the margin to the left of the line number where you want to set the checkpoint. You can enable up to five checkpoints at the same time.
    
    Results for a checkpoint are captured only once, no matter how many times the line of code is executed. By default, the results for a checkpoint are captured immediately before the first time the line of code is executed. You can change the iteration for the capture from the Checkpoint Locations list on the Checkpoints tab. You can also overlay Apex code and SOQL statements that run when code executes at a checkpoint.
3. Execute the code with the Developer Console open.
4. View your checkpoints and results on the Checkpoints tab.

Checkpoints persist until you click **Debug** | **Clear Checkpoint Locations**.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note If you set a checkpoint in a method with the [`@future` annotation](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_future.htm), you must keep the Developer Console open until the `@future` method completes asynchronously.

#### See Also

- [Checkpoints Tab](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_tab_checkpoints.htm&release=264.0.0&type=5 "The Checkpoints tab displays a list of saved checkpoints that preserve a snapshot of the state of objects in memory at the time the checkpoint was reached.")
- [Log Inspector](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_view_system_log.htm&release=264.0.0&type=5 "The Log Inspector is a context-sensitive execution viewer in the Developer Console. It shows the source of an operation, what triggered the operation, and what occurred next. Use this tool to inspect debug logs that include database events, Apex processing, workflow, and validation logic.")
- [Overlaying Apex Code and SOQL Statements](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_overlaying_soql.htm&release=264.0.0&type=5 "Use the Developer Console to overlay diagnostics that run when Apex code executes at a checkpoint, without changing any code.")
- [Checkpoint Inspector](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_view_checkpoints.htm&release=264.0.0&type=5 "Use checkpoints to investigate the objects in memory at a specific point of execution and see the other objects with references to them.")