Git Product home page Git Product logo

chrome-salesforce-inspector's Introduction

Salesforce inspector

Chrome and Firefox extension to add a metadata layout on top of the standard Salesforce UI to improve the productivity and joy of Salesforce configuration, development, and integration work.

Test Status

Installation

☀️ Add to Chrome ☀️ Add to Firefox

Features

  • Quickly view field information directly from a record detail page, edit page or Visualforce page.
  • Quickly view and edit all data for a record, even data that is not on the page layout.
  • Perform quick one-off data exports and imports directly from within Salesforce. Data can be easily copied to and from Excel. No need to log in again when you are already logged in with your browser.
  • View current limits consumption
  • Simple access to user record details incl. simpler access to "login as". E.g. when hopping between test users.
  • And more...

Inspector menu

Show field metadata

Show all data for record

Data exporter

Data importer

Monitor limits

Security and Privacy

The Salesforce Inspector browser extension/plugin communicates directly between the user's web browser and the Salesforce servers. No data is sent to other parties and no data is persisted outside of Salesforce servers after the user leaves the Salesforce Inspector pages. The Inspector communicates via the official Salesforce webservice APIs on behalf of the currently logged in user. This means the Inspector will be capable of accessing nothing but the data and features the user has been granted access to in Salesforce.

All Salesforce API calls from the Inspector re-uses the access token/session used by the browser to access Salesforce. To acquire this access token the Salesforce Inspector requires permission to read browser cookie information for Salesforce domains.

To validate the accuracy of this description, inspect the source code, monitor the network traffic in your browser or take my word.

Troubleshooting

  • If Salesforce Inspector is not available after installation, the most likely issue is that your browser is not up to date. See instructions for Google Chrome.
  • When you enable the My Domain feature in Salesforce, Salesforce Inspector may not work until you have restarted your browser (or until you have deleted the "sid" cookie for the old Salesforce domain by other means).

Development

  1. Install Node.js with npm
  2. npm install

Chrome

  1. npm run chrome-dev-build
  2. Open chrome://extensions/.
  3. Enable Developer mode.
  4. Click Load unpacked extension....
  5. Select the addon subdirectory of this repository.

Firefox

  1. npm run firefox-dev-build
  2. In Firefox, open about:debugging.
  3. Click Load Temporary Add-on….
  4. Select the file addon/manifest.json.

Unit tests

  1. Set up an org (e.g. a Developer Edition) and apply the following customizations: 1.a. Everything described in metadata in test/org/. Push to org with sfdx force:mdapi:deploy --deploydir test/org -w 1000 -u [your-test-org-alias] 1.b. Ensure Allow users to relate a contact to multiple accounts is enabled (Setup→Account Settings) 1.c. Ensure the org has no namespace prefix (Setup→Package Manager)
  2. Navigate to one of the extension pages and replace the file name with test-framework.html, for example chrome-extension://example/test-framework.html?host=example.my.salesforce.com.
  3. Wait until "Salesforce Inspector unit test finished successfully" is shown.
  4. If the test fails, open your browser's developer tools console to see error messages.

Linting

  1. npm run eslint

Release

Version number must be manually incremented in addon/manifest-template.json file

Chrome

If the version number is greater than the version currently in Chrome Web Store, the revision will be packaged and uploaded to the store ready for manual release to the masses.

Firefox

  1. npm run firefox-release-build
  2. Upload the file from target/firefox/firefox-release-build.zip to addons.mozilla.org

Design Principles

(we don't live up to all of them. pull requests welcome)

  • Stay completely inactive until the user explicitly interacts with it. The tool has the potential to break Salesforce functionality when used, since we rely on monkey patching and internal APIs. We must ensure that you cannot break Salesforce just by having the tool installed or enabled. For example, we won't fix the setup search placeholder bug.
  • For manual ad-hoc tasks only. The tool is designed to help administrators and developers interact with Salesforce in the browser. It is after all a browser add-on. Enabling automation is a non-goal.
  • User experience is important. Features should be intuitive and discoverable, but efficiency is more important than discoverability. More advanced features should be hidden, and primary features should be central. Performance is key.
  • Automatically provide as much contextual information as possible, without overwhelming the user. Information that is presented automatically when needed is a lot more useful than information you need to explicitly request. For example, provide autocomplete for every input.
  • Provide easy access to the raw Salesforce API. Enhance the interaction in a way that does not break the core use case, if our enhancements fails. For example, ensure we can display the result of a data export even if we cannot parse the SOQL query.
  • It is fine to implement features that are already available in the core Salesforce UI, if we can make it easier, smarter or faster.
  • Ensure that it works for as many users as possible. (for system administrators, for standard users, with person accounts, with multi currency, with large data volumes, with professional edition, on a slow network etc.)
  • Be conservative about the number and complexity of Salesforce API requests we make, but don't sacrifice the other principles to do so.
  • Focus on system administrators, developers and integrators.

About

By Søren Krabbe and Jesper Kristensen

License

MIT

chrome-salesforce-inspector's People

Contributors

dependabot[bot] avatar evazi avatar jefersonchaves avatar jesperkristensen avatar sorenkrabbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chrome-salesforce-inspector's Issues

Show description column in field overview

In the field overview window, a column with the field description should be added.

Note that the description fields is not readily available via the APIs you could expect.

More guided data export option

It should be possible to optionally choose a more guided form, so the user does not need to know how to write a SOQL query.

It should work in Salesforce1 / Lightning Experience

To fix this:

  • The lightning domain should receive the session key from the salesforce domain, like how the visualforce domain does. Except we may need another solution, as the user may not nessesarily have visited the salesforce domain before visiting the lightning domain.
  • The lightning domain does not support API requests, so we need to perform cross-origin requests.
  • The button to open the menu should be visible in the Lightning UI.
  • The Show field metadata functionality should be adapted to lightning, including both changed HTML structure and the fact that the page does not reaload between navigations.

Reverted version number change

I had to revert a change in 9885d99 since otherwise chrome would refuse to load the addon with an error message saying the version number was malformed.

Integrated data export and import

It should be easier to perform a data import based on a data export. For example:

  • Delete all records that match a particular SOQL query
  • Copy the value of one field into another for all records matching a query
  • Set a field to a static value for all records matching a query

SOQL autocomplete should support subqueries

We should detect when we have a subquery and autocomplete field names related to the sub object instead of the main object.

For example a query for accounts with open opportunities:

select Id from Account where Id in (select AccountId from Opportunity where

Here we should autocomplete Opportunity fields instead of Account fields.

Data import and export windows should not auto-close when their parent is navigated

In order to support both Chrome and Firefox without duplicating our code, we run all JavaScript in the content script attached to the main Salesforce page. This means that when the user navigates away from this Salesforce page, our pop-up windows (show all data, data export and data import) will not work anymore, when the JavaScript is gone. To avoid these broken windows we close all our pop-ups when the user navigates away from the parent Salesforce page. We should find a fix for this, so we don't need to close the pop-ups. This is mostly an issue for the data export and data import windows, and not so much of an issue for the show all data window. Fixing this may depend on https://bugzilla.mozilla.org/show_bug.cgi?id=792479

SOQL autocomplete should suggest keywords

At certain positions in the query we should be able to determine that a field name cannot be legal at the given position and we should autosuggest keywords instead (select, from, where, and, or, not, ...)

Winter 16 exception in Show all data

Show all data window shows this error message in Winter 16:

Error querying tooling particles: [{"message":"","errorCode":"UNKNOWN_EXCEPTION"}]

Add "retry" button to data import window

When a data import is finished with some errors or cancelled records, add a "retry" button that copies the output into the input to make it more discoverable that this is supported.

Cannot sort by columns

The ability to sort by columns would be extremely usefull in the "View all data" view.

Write unit tests

We have unit tests now for data export. We should have it for the rest of the features.

Field id and description errors in Summer 15

In Summer 15, these errors appear:

Error getting setup links: [{"message":"When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2000","errorCode":"MALFORMED_QUERY"}]
Error getting field descriptions: [{"message":"When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 356","errorCode":"MALFORMED_QUERY"}]

Autocomplete field values in data export query

The autocomplete for the data export query currently supports autocompleting field names and picklist values. It would be nice if it could autocomplete other field values. Example:

  • select Id from User where Profile.Name = ' should suggest valid profile names
  • select Id from Account where RecordType.DeveloperName = ' should suggest valid record type names (possibly limited to names valid for the Account object)

Since we may need to issue an API call for each suggestion, we may require that the user actively requests the suggestions (for example by pressing Ctrl+Space).

The csvSerialize function in data import is slow

When importing lots of data, the browser freezes in the csvSerialize function. (5000 records, 1.9 MB CSV, Firefox 36, Intel Core i5 2540M) This function should not be the most resource intensive part of the import, so it should be possible to optimize it. I would expect csv parsing or xml construction to require more resources.

The sample query in the data export popup should be based on the current page

When opening the data export popup, the query input is initialized with a sample query "select Id from Account". We should select the object in this sample query dynamically instead of always using Account. For example if you are viewing an Opportunity record, the sample query should be "select Id from Opportunity".

The data import dialog should autocomplete field names

When editing CSV column headers (field names) in the data import dialog, the tool should suggest valid field names for the columns, similar to how the data export dialog suggests valid field names for the SOQL query.

Default result format for data import/export should be table instead of Excel

This will require performance optimization of the table view, for example by lazy displaying rows as you scroll.

We could then use a button you click to copy Excel/CSV format, so we don't have to show it in the browser, once browsers support the execCommand("copy") API, which they are currently implementing.

Support showing all fields for the data export autocomplete

The field name suggestions in the data export popup is shown on a single row. If there are too many fields to fit on a row, only the first fields will be visible. This is done to prevent the entire UI from flickering wildly as you type the query.

We should support a mode where all fields are shown. When in this mode, we could consider adding ", " (comma + space) after the field name when a suggestion is selected. This would enable the user to place the cursor after the "select" keyword and then choose desired columns by clicking the suggestions one by one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.