Skip to content

How to

Use Sf Inspector with a connected app


For Chrome and Edge users

If you enabled "API client whitelisting" (a.k.a "API Access Control") in your org, SF Inspector may not work anymore.

To secure the extension usage, you can use a OAuth 2.0 flow to get an access token, linked to a connected app installed in your org. To install the default "SF Inspector reloaded" connected app, open popup and click 'Generate Access Token' button

Generate Token

Then navigate to Setup | Connected Apps OAuth Usage, and click "Install" on the Salesforce Inspector reloaded app.

From now when the token will be expired, this banner will show up and provide a link to re-generate the access token

image

Warning Don't forget to grant access to the users by selecting the related profile(s) or permission set(s).

If you are a Firefox user, or if you want to have full control over the connected app settings, you can also use your own connected app by following these instructions:

For Firefox users

  1. Create a connected app under Setup | App Manager > New Connected App.
  2. Set callback url to chrome-extension://chromeExtensionId/data-export.html (replace chromeExtensionId by the actual ID of the extension in your web browser). Make sure the "Manage user data via APIs (api)" scope is selected. You can leave other settings to their default values.

Warning Don't forget to replace "chromeExtensionId" with your current extension Id Connected App

  1. Get Consumer Key and save it in the Options page

Option button

  1. Enter the consumer key

Client Id

  1. Refresh page and generate new token

Generate Token

Migrate saved queries from legacy extension to Salesforce Inspector Reloaded

  1. Open data export page on legacy extension Inspect legacy
  2. Get saved queries from insextSavedQueryHistory property Inspect legacy
  3. Open it in VS Code, you should have a JSON like this one:
[
  { "query": "select Id from Contact limit 10", "useToolingApi": false },
  { "query": "select Id from Account limit 10", "useToolingApi": false }
]

From there you have two options

Import the queries by adding a label for each one with the label in query property suffixed by ":" ie.

[
  {
    "query": "Contacts:select Id from Contact limit 10",
    "useToolingApi": false
  },
  {
    "query": "Accounts:select Id from Account limit 10",
    "useToolingApi": false
  }
]

Re-import this json in the new extension (with the same key insextSavedQueryHistory)

Define a CSV separator

Add a new property csvSeparator containing the needed separator for CSV files

Update csv separator

Disable query input autofocus

Add a new property disableQueryInputAutoFocus with true

image

Add custom query templates

Enter value in "Query Templates" option with your custom queries separated by "//" character. Example:

SELECT Id FROM// SELECT Id FROM WHERE//SELECT Id FROM WHERE IN//SELECT Id FROM WHERE LIKE//SELECT Id FROM ORDER BY//SELECT ID FROM MYTEST__c//SELECT ID WHERE

image

If you want to always open extension's links in a new tab, you can set the openLinksInNewTab property to true

image

If you want to open popup keyboard shortcuts, you can use the 'ctrl' (windows) or 'command' (mac) key with the corresponding key. Example:

  • Data Export : e
  • Data Import : i
  • Org Limits : l
  • Download Metadata : d
  • Explore API : x

Disable metadata search from Shortcut tab

By default when you enter keyword in the Shortcut tab, the search is performed on the Setup link shortcuts AND metadata (Flows, PermissionSets and Profiles). If you want to disable the search on the metadata, set metadataShortcutSearch to false

image

Enable / Disable Flow scrollability

Go on a Salesforce flow and check / uncheck the checbox to update navigation scrollability on the Flow Builder

2023-09-29_16-01-14 (1)

Because one of the main use case for custom links is to refer to a record in your org, those links are stored under a property prefixed by the org host url. You can find the value by checking the property _isSandbox

image

Then copy the url and add _orgLinks for the property name. Now you can enter the custom links following this convention:

[
  {
    "label": "Test myLink",
    "link": "/lightning/setup/SetupOneHome/home",
    "section": "Custom",
    "prod": false
  },
  {
    "label": "EnhancedProfiles",
    "section": "Custom",
    "link": "/lightning/setup/EnhancedProfiles/home",
    "prod": false
  }
]

ET VOILA !

image

Enable summary view of PermissionSet / PermissionSetGroups from shortcut tab

Since Winter 24, there is a beta functionality to view a summary of the PermissionSet / PermissionSetGroups

image

You can enable this view for the Shortcut search by creating a new localVariable as shown below.

image

Then when you click on a PermissionSet / PermissionSetGroups search result, you'll be redirected to the summary.

Customize Create / Update rest callout headers (to prevent execution of auto assignment rules for Accounts, Cases, or Leads)

Assignment Rule Header

From the popup, click on "Options" button and select the API tab.

image

If you want to prevent auto assignment rules, set the createUpdateRestCalloutHeaders property to {"Sforce-Auto-Assign" : false}

Update API Version

Since the plugin's api version is only updated when all productions have been updated to the new release, you may want to use the latest version during preview windows.

[!IMPORTANT] When you manually update the API version, it won't be overriden by extension future updates.

2023-11-10_09-50-55 (1)

Download Event Log Files

To make your life easier and avoid third party tools or login to ELF website, we implemented the download option from the data export page. When quering EventLogFile, add the "LogFile" field in the query and click on the value to download corresponding log.

2023-11-15_14-32-44 (1)

Enable debug logs

Sometimes you may want to enable logs for a particular user. From User tab, click the "Enable Log" button.

By default, this will enable logs with level "SFDC_DevConsole" for 15 minutes.

Enable Log button

You can update the debug level (configuration is per organization) and duration (for all organizations) on the Options page.

DebugLog Options

Warning Increasing the default duration may lead to a high volume of logs generated.

Display query performance in Data Export

To enable performance metrics for queries on the data export page, open the Options screen and select the Data Export tab, then set "Display Query Execution Time" to enabled. Total time for the query to process and, when applicable, batch stats (Total Number of Batches, Min/Max/Avg Batch Time) are displayed.

Test GraphQL query

  • Open popup and click on "Explore API" button.
  • Right click on the page and select "Inspect"
  • Execute the code in dev console:

var myQuery = { "query": "query accounts { uiapi { query { Account { edges { node { Id Name { value } } } } } } }" }; display(sfConn.rest("/services/data/v59.0/graphql", {method: "POST", body: myQuery}));

2024-02-09_17-01-42 (1)

Customize extension's favicon

From the option page, you can customize the default favicon by:

  • a predefined color among those values (green, orange, pink, purple, red, yellow)
  • a custom favicon url (ie "https://stackoverflow.com/favicon.ico")

The customization is linked to the org, it means you can have different colors for DEV and UAT env for example.

image

Select all fields in a query

This functionality already exists in the legacy version but since many users don't know about it, I would like to document it. When on the export page, put the cursor between SaELECT and FROM and press Ctrl + space for inserting all fields (if you don't have the rights for a particular field, it wont' be added). If you want to insert only custom fields, enter __c between SELECT and FROM.

2024-04-16_08-53-32 (1)