Slaesforce FAQ

how to use checkpoints in salesforce

by Dr. Isadore Stroman Published 3 years ago Updated 2 years ago
image

Enhance Salesforce with Code Checkpoint Inspector 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.

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 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 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 set a checkpoint for the trace flag?

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. Click in the margin to the left of the line number where you want to set the checkpoint.

image

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.

Which type of information is provided by the checkpoints tab?

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.

How do I add a checkpoint in Salesforce?

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

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.

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.

What is a capability of the developer console?

The Developer Console allows you to browse, open, edit, and create source code files. Browse Packages in Your Organization: Navigate the contents of packages created in your organization.

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.

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