---
schema_version: "1"
id: b0372c2630d635439d8e31915119e49d64bd6aaaede3dd5c53bd0449f6e19340
title: Overlaying Apex Code and SOQL Statements
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_overlaying_soql.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_overlaying_soql.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: dafdc6874ec5bc5617b80fc56ddb609fe8119c72dec528e4bede8f485d7c3eef
description: Use the Developer Console to overlay diagnostics that run when Apex code executes at a checkpoint, without changing any code.
products:
  - Salesforce Platform
release: "264"
---
# Overlaying Apex Code and SOQL Statements

Use the Developer Console to overlay diagnostics that run when Apex code executes at a checkpoint, without changing any code.

See [Setting Checkpoints in Apex Code](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_setting.htm&release=264.0.0&type=5 "Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.").

When troubleshooting a runtime issue, you might want information about the state of a variable or the state of the database. You might also want to create a specific condition in which to test your code. The Developer Console allows you to overlay Apex code and SOQL statements that run when code executes at a checkpoint.

1. Set checkpoints and execute your code, then go to the **Checkpoints** tab.
2. Select a checkpoint and click **Edit Properties**.
3. Select **SOQL** or **Apex Code**. To run the diagnostic code without generating a heap dump at the checkpoint, deselect **Dump Heap**.
    
    ![Execution Action Properties](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/extend_code/images/code_dev_console_browser_heap_dumps_actions.png)
4. Enter SOQL or Apex code in the **Action Script** box and click **OK**.
    
    ![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
    
    You can’t refer to local objects because an anonymous block is a new stack frame. Refer to static objects or create new objects. Also, you can't use bind variables in SOQL queries used in overlays.

The results of the overlayed code will appear on a separate **Query Results** or **Apex Execution Results** tab in the Checkpoint Inspector.

![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 On the **Apex Execution Results** tab, the value `-1` indicates that a field is not applicable.

#### 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.")
- [Set Checkpoints in Apex Code](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_checkpoints_setting.htm&release=264.0.0&type=5 "Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.")
- [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.")