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.

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
  4. Enter SOQL or Apex code in the Action Script box and click OK.
    Note
    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
Note On the Apex Execution Results tab, the value -1 indicates that a field is not applicable.