Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I currently run the Apex code using Anony exec/test class and Check the system debug logs or write system.debug to check the logs. But I feel the need to check line by line debugging of the code, with a watch window showing the values that variable processes.

In short, I am looking for the internal detail of my code when developing. Something similar to the "Watch Window" in C. Is it possible?

I have read developer console section, for Checkpoint, but wasn't clear on its use.

Has any one used "Set and View Checkpoints in Apex Code:" option from DeveloperConsole and can share how to use it.

share|improve this question
1  
Have a look at this question. Lots of useful into there: salesforce.stackexchange.com/questions/36582/… –  Jagular Aug 1 at 14:14
    
Thanks @Jagular will check:) –  user10727 Aug 1 at 15:02

2 Answers 2

Salesforce do not allow true breakpoints and single stepping as this puts too much load on their servers because instead of a transaction being short lived a debugging session can leave a transaction open for many minutes. The lack of these normal debugging mechanisms makes developing logic of any complexity more challenging in Apex than in many other languages.

The nearest approximation offered - the Checkpoint mechanism (AKA "Simulated Breakpoints") - requires you to decide up front where in your code you want to examine the state so that the tooling can take a copy of the state and then move on, thus avoiding significant delay in the transaction. So instead of picking a few items of data to output (as you do by adding a System.debug call) you get a more comprehensive view of the data (at the nominated point(s) in your code).

I've only tried to use this when it was first released and didn't find it very helpful then so still just use System.debug. Others may be able to report more positive experiences and advice on how to use Checkpoints effectively in their answers here...

share|improve this answer
up vote 0 down vote accepted

Have a look at this question. Lots of useful into there: salesforce.stackexchange.com/questions/36582/… – Jagular Aug 1 at 14:14

Refer the video links provided in ( https://www.youtube.com/watch?v=I8EtxMLfFDQ), its very informative and explains with lots of navigational checks as well to understand the process better.

share|improve this answer
    
This doens't actually answer the question. Can you edit this answer to show the content that actually solved your problem? –  LaceySnr Sep 1 at 5:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.