As a Salesforce developer, you may encounter bugs or unexpected behaviour in your Apex code during runtime. To resolve these issues, you need to be able to pause the code execution and inspect the values of variables, evaluate expressions, and view the call stack. That's where checkpoints in the Salesforce Developer Console come in.
A checkpoint in the Salesforce Developer Console is a feature that allows developers to temporarily pause the execution of Apex code for the purpose of debugging and inspection. Checkpoints enable developers to view the values of variables, inspect the call stack, and evaluate expressions at specific points in the code execution, helping them to identify and resolve issues more effectively.
Checkpoints are used in Apex to debug and inspect the behaviour of code during runtime. They allow developers to pause the execution of the code at a specific point, inspect the values of variables, evaluate expressions, and view the call stack. This information can be used to identify issues, such as bugs or unexpected behaviour, and to better understand the behaviour of the code. By using checkpoints, developers can more efficiently identify and resolve issues in their code, leading to improved overall performance and reliability. New Paragraph
Go to the developer console, click on File, Open, and then open the class where you want to add the Checckpoint.
On the Left handside of the screen, Click on the left-hand-side of the the line number to add the check point that line.
Below of the developer console, you will see the Check point tab.
Here you can see all added check points list.
Execute the class via Execute anonymous window, or via Running the LWC component, or via perforning DML. Any way in which you wanna want
Once the Class execution finished, you will see the your logs are generated on the checkpoint tab, you can click on it and revoew the logs.