![]() ![]() To set an exception breakpoint, press Ctrl+Shift+P (Windows or Linux) or Cmd+Shift+P (macOS) to open the Command Palette, then select SFDX: Configure Apex Debug Exceptions. The Call Stack panel in the Debug view shows the name of the exception. When an exception breakpoint is hit, the debugger pauses on the line of code that caused the exception. To make Apex Debugger halt execution when an exception is thrown during a debugging session, set breakpoints on exceptions. For more information, see Debugging in the Visual Studio Code docs. You can debug up to two threads at a time. You can also step through your code, using the Debug actions pane that appears at the top of the editor while a debugging session is in progress, and watch those values change. While execution is paused, you can inspect the call stack and see the current values of your variables. While a debugging session is in progress, any synchronous activity that runs a line of code with a breakpoint causes execution to halt at the breakpoint. Then, click the green play icon (hover text: Start Debugging). To start a debugging session, from the configuration dropdown menu at the top of the Debug view, select Launch Apex Debugger. You can see a list of your breakpoints in the Breakpoints panel of the Debug view. trigger file and click the column to the left of the line numbers. Make sure you disable that extension while using ours. It conflicts with our official extension. vscode directory.Īn unofficial debugger extension called Salesforce Apex Debug is available in the Visual Studio Marketplace. Each project needs only one launch.json file, even if you work with multiple scratch orgs. The minimum information it should contain: Within the "configurations" array, add a "Launch Apex Debugger" configuration.(If you’ve already created this file, clicking the gear icon opens the file.) To create a launch.json file, click the gear icon (hover text: Configure or Fix launch.json) and then select Apex Debugger.To open the Debug view, in the VS Code Activity Bar, click the bug icon (hover text: Debug).In VS Code, create a launch configuration for Apex Debugger.If you have a copy of the permission set in your Salesforce DX project, you can assign permissions to scratch org users by running sfdx force:user:permset:assign -n Your_Perm_Set_Name. Then, add your new permission set to your source control repository. Optional: In VS Code, run SFDX: Pull Source from Default Scratch Org.Select the users to whom you want to assign the permission set, and then click Assign. ![]() The other permissions that Debug Apex requires are added automatically. Choosing None lets you assign the permission set to more than one type of user. In the “Select the type of users who will use this permission set” section, choose None from the User License dropdown list.Give the permission set a name that you can remember, such as Debug Apex.In your browser, from Setup, enter Permission Sets in the Quick Find box, then select Permission Sets.In VS Code, run SFDX: Open Default Org.When your scratch org is ready, assign permissions for Apex Debugger to the org’s admin user.Choose a scratch org definition file that includes the DebugApex feature.In VS Code, run SFDX: Create a Default Scratch Org.Add the DebugApex feature to the scratch org definition files for all the types of scratch orgs that you plan to debug:.If you don’t have an Apex Debugger license, use the Replay Debugger. Note: You can use the default license provided to License Management orgs only with the ISV Customer Debugger to debug subscriber orgs. The first time that you use Apex Debugger in VS Code, complete these setup steps. To debug subscribers’ sandbox orgs, use ISV Customer Debugger, which is part of the Apex Interactive Debugger extension. Output your results to the Debug Console.Complete standard debugging actions, including step into, over, and out, and run to breakpoint. ![]() (When you inspect objects that have managed types that aren’t visible to you, only global variables are displayed in the variable inspection pane.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |