Slaesforce FAQ

how to use checkpoints in salesforce developer console

by Sheldon Wilderman Published 2 years ago Updated 2 years ago
image

Right click any column header to sort the information in the column. You can also select which columns you want displayed in the Checkpoints list. To open a checkpoint, double-click it.

Set Checkpoints in Apex Code
  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. ...
  3. Execute the code with the Developer Console open.
  4. View your checkpoints and results on the Checkpoints tab.

Full Answer

How do I set checkpoints in Salesforce?

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.

How do I set checkpoints in the source code?

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. See Logs Tab. Open the Apex class or trigger in the Source Code Editor.

How do I enable checkpoints in apex?

Open the Apex class or trigger in the Source Code Editor. 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.

How do I use checkpoints in the developer console?

In the Checkpoints tab of the developer console, click on the checkpoint to explore the file tree. Here we can see that the title of the book is Don Quixote and the price is $30 at the point of the checkpoint: You can set up to 5 checkpoints at once. Using multiple checkpoints can help you figure out where exactly variable information changes.

image

What information is provided in Checkpoints tab in the Developer Console?

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.

What are checkpoints in Salesforce?

Use checkpoints to investigate the objects in memory at a specific point of execution and see the other objects with references to them. Go to the Checkpoints tab and double-click a checkpoint to view the results in the Checkpoint Inspector.

Can we use checkpoints with asynchronous apex?

Yes, they do. I just tested it with an asynchronous test case. The trick here is you need to have an active TraceFlag with the Apex Code logging level set to Finer or Finest. See Setting Checkpoints in Apex Code.

What is Developer Console workspace?

A workspace is a collection of resources represented by tabs in the main panel of the Developer Console. The detail view or editor shown in each tab is determined by the type of resource open in the tab. For example, source code opens in the Source Code Editor, logs open in the Log Inspector, and so on.

How do you set a checkpoint in debug log in production?

Let's set a checkpoint in the EmailMissionSpecialist class that we created earlier.Select File | Open, and open the EmailMissionSpecialist class.Select Debug | Change Log Levels.In the General Trace Settings for You section, click Add/Change.Set the ApexCode log level to FINEST. ... To save your changes, click Done.More items...

How do I trace Apex code execution SalesForce?

Use checkpoints, logs, and the View State tab to help debug the code you've written.Set Checkpoints in Apex Code. Use Developer Console checkpoints to debug your Apex classes and triggers. ... Overlaying Apex Code and SOQL Statements. ... Checkpoint Inspector. ... Log Inspector. ... Use Custom Perspectives in the Log Inspector. ... Debug Logs.

How do I debug a batch job in SalesForce?

Step 2: Run the BatchMake sure you have assigned your own email address to one of the speakers.In the Developer Console, click Debug > Open Execute Anonymous Window.Type the following Apex code: ... Click Execute.Check your email.

Set Checkpoints in Your Apex Code

The moment your spaceship starts sounding system errors, you have to head straight to the logs to figure out what went wrong and where.

Checkpoints Tab

You can view exactly where your code’s execution is going wrong, and what the values of the objects are at that point, using the Checkpoints tab. Let’s run this code to see the checkpoint in action.

Heap Tab

The Heap tab includes some great panels for debugging, like the Types panel. This panel shows how many objects were instantiated and the memory they consumed in bytes. Let’s look at the details captured by the checkpoint you set.

Symbols Tab

The Symbols tab is a quick and simple way to review the states of various objects at any checkpoint. Symbols are unique names that reference particular objects. The tab displays all symbols in memory using a tree view.

Hands-on Challenge

You’ll be completing this challenge in your own hands-on org. Click Launch to get started, or click the name of your org to choose a different one.

Checkpoints

This list displays the checkpoints currently available for review. Select Debug | My Current Checkpoints Only to only display checkpoints you’ve created since opening the Developer Console. Deselect this option to display all checkpoints currently saved for your organization, including newly-generated ones created by other users.

Checkpoint Locations

This list provides the location of each checkpoint in the source code. Each item in the list displays this information:

What is a checkpoint in Salesforce?

Salesforce has a concept called “checkpoints”. With checkpoints, you can “investigate the objects in memory at a specific point of execution and see the other objects with references to them.”. You can get a dump of variable information at the time of that checkpoint.

What is Salesforce debugging?

A major part of any Salesforce developer’s job is debugging. Because Salesforce has a multitenant architecture, debugging on the platform is a bit different than it might be in other development environments (e.g., you can’t breakpoint your code or do live debugging) though it is useful nonetheless. “90% of coding is debugging.

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9