Run SFDX: Turn On Apex Debug Log for Replay Debugger.Note: If you modify your Apex code or toggle checkpoints, run this command again to stay in sync.
#Visual studio code debugger step one update
Open the command palette, and run SFDX: Update Checkpoints in Org to upload your checkpoints to your org to collect heap dump information.Set up Apex Replay Debugger for debugging more complicated issues such as Queuable Apex or Apex trigger issues in your org: For an Anonymous Apex file, a new log file opens in a window. The command updates checkpoints in your org, sets (and deletes upon completion) trace flags, and generates a new debug log. Run SFDX: Launch Apex Replay Debugger with Current File from the command palette (or select the command by right-clicking inside an open file).Open your Apex test class or Anonymous Apex class with checkpoints or breakpoints set up.Quickly debug your Apex development work without explicitly setting trace flags: To upload your checkpoints to your org to collect heap dump information, open the command palette, and run SFDX: Update Checkpoints in Org.Or, to convert an existing breakpoint into a checkpoint, right-click the breakpoint, and select Edit Breakpoint | Expression.Or, right-click in the gutter to the left of the line numbers, select Add Conditional Breakpoint | Expression, and set the expression to Checkpoint.
#Visual studio code debugger step one windows
Open the command palette (press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS).Click the line of code where you want to set the checkpoint.Set checkpoints on up to five lines in Apex classes or triggers.Set up and upload your checkpoints before you start an Apex Replay Debugger session. Checkpoints function like breakpoints while replay debugging from a log. In Visual Studio Code, a checkpoint is a type of breakpoint. Trigger context variables don’t exist in logs and are available only at checkpoint locations. All local variables, static variables, and trigger context variables have better information at checkpoints. You can set up to five checkpoints to get heap dumps when lines of code run. trigger file and click the column to the left of the line numbers.įor more information than line breakpoints provide, add checkpoints. Set Breakpoints and Checkpointsīefore you generate a debug log for replay debugging, set breakpoints and checkpoints. You can invoke this command on an Apex test file, Anonymous Apex file or an Apex log file. Debug your code using the Launch Apex Replay Debugger with Current File command.