ISV Customer Debugger

ISV Customer Debugger

Salesforce ISVs (Independent Software Vendors) are developers who create managed packages on the Salesforce Platform that are available on Salesforce AppExchange. A package subscriber doesn’t have access to managed code, which can make debugging challenging. The ISV Debugger lets an ISV reproduce issues in the subscriber’s environment in a sandbox org for convenient debugging. With the ISV Debugger, an ISV can work with a subscriber to debug issues specific to the subscriber’s org.

Configure ISV Customer Debugger

ISV Customer Debugger is part of the Apex Interactive Debugger (salesforcedx-vscode-apex-debugger) extension, so you don’t need to install anything other than the Salesforce Extension Pack and its prerequisites. You can debug only sandbox orgs.

  1. Log into your License Management Org (LMO) and enable the View and Debug Managed Apex permission for your users in Setup using profiles or permission sets.
  2. Log in to your subscriber’s sandbox via your License Management Org (LMO). If you’re not familiar with this process, see the ISVforce Guide. For information on how to obtain login access to your subscriber’s org, see Request Login Access from a Customer. For information on how to log in via the Subscriber Support Console, see Logging In to Subscriber Orgs.
  3. In your subscriber’s org, from Setup, enter Apex Debugger in the Quick Find box, then click Apex Debugger.
  4. Click Start Partner Debugging Session.
  5. In the Using Salesforce Extensions for VS Code section, to copy the forceide:// URL, click Copy to Clipboard.
  6. In VS Code, press Ctrl+Shift+P (Windows or Linux) or Cmd+Shift+P (macOS) to open the Command Palette, then run SFDX: Create and Set Up Project for ISV Debugging.
  7. When directed, paste the forceide:// URL into the prompt, and press Enter.
  8. When directed, either accept the default project name or enter a name for your debugging project, and press Enter.
  9. Choose a location to store the project, and click Create Project.
  10. Wait for the project generation process to finish. VS Code retrieves your packaged metadata, your subscriber’s metadata, and skeleton classes for other packages in the org, converts them to source format, and creates a Salesforce DX project. VS Code also creates a launch configuration (launch.json file) for the project. This process can take a long time, especially for orgs that contain lots of metadata, so feel free to leave it running and check back later. You can monitor the progress in the output panel at the bottom of VS Code. To show the output panel, select View > Output, then select Salesforce CLI from the dropdown menu in the corner of the Output tab.
    When the project is ready, VS Code opens it for you in a new window.
  11. In the new window, from the Explorer view, open an Apex class or trigger that you want to set breakpoints in.
  12. To set a breakpoint, click the gutter to the left of the line numbers.
  13. Switch to the Debug view.
  14. To launch Apex Debugger, click the play icon next to the launch configuration dropdown menu.

Debug Your Subscriber’s Org

With one noteworthy exception, debugging a subscriber’s org works the same way that debugging other orgs does. The exception: You can’t break on Apex events triggered by other users in the org. Only the Login As user can trigger Apex breakpoint hit events.

See the rest of this README for information about Apex Debugger. For general information about debugging in VS Code, see Debugging in the Visual Studio Code docs.

Renew a Debugging Session

If your session expires, start a new session from Setup using all the same steps that you followed when you started the original session.

Protect Your Subscriber’s Intellectual Property

The code from your subscriber’s org is your subscriber’s intellectual property. We advise against keeping it around after you’re done debugging. Delete the entire project from the location where you stored it during the setup process. Never store your subscriber’s metadata in your version control system. When you start a new debugging session later, VS Code downloads the metadata for you again.

ISV Customer Debugger Considerations

For general Apex Debugger limitations and known issues, see Considerations in the Apex Interactive Debugger article. When working with ISV Customer Debugger, keep these additional considerations in mind.

  • You can debug only sandbox orgs.
  • You can debug only one customer at a time. However, if you purchase Apex Debugger licenses, you can debug multiple customers at once. An Apex Debugger license also lets you debug in your sandboxes and scratch orgs.
  • When you click Return to subscriber overview, your debugging session terminates. Stay logged in to your subscriber’s org while you debug, and return to your LMO only when you’re done debugging.

Feedback or Bugs | Edit this Article