Autocomplete Lookups for Salesforce

November 13, 2012

'Just found out, Salesforce has Autocomplete'

‘Just found out, Salesforce has Autocomplete’

UPDATE Fri 31 May: I am excited to share that I have turned this project into an AppExchange app.  It will be released under a new company called Tapply.  The product will be called Autocomplete Lookups for Salesforce and will allow you to search using any field on the related object and display any field as the label in the search results. Find out more here.

 

This week I cooked up an Autocomplete component for Salesforce.  Once installed it allows any Lookup field to support autocomplete.

How it works

Autocomplete for Salesforce works by installing a homepage component in the left hand column which finds all the lookup fields on the page ‘autocompletifies’ them.  This means that as you start typing Autocomplete for Salesforce starts suggesting records in a similar way to Google.

How to get it

Autocomplete for Salesforce is very new and only available in BETA.  This means it can currently only be installed in Developer and Sandbox environments.  If you are interested and would like to test this in your Developer or Sandbox environment then you can follow these instructions:

Installing the Managed Package

  • While logged into the Developer or Sandbox environment you would like to install Autocomplete for Salesforce into append the following to the URL[domain eg. na1].salesforce.com/packaging/installPackage.apexp?p0=04tG0000000JXvz
  • Salesforce will guide you through the steps to install the Managed Package into your environment
Example of Autocomplete for Salesforce

Example of Autocomplete for Salesforce

Once installed there are a few steps before you can get going:

  • Autocomplete for Salesforce relies on some smarts concealed within a homepage component in the left hand nav of Salesforce.  To enable this navigate to Setup > Customise > Home > Homepage Layouts then edit each layout selected the ‘Autocomplete’ component
  • Navigate to the User Inserface settings in the setup menu and check that the option ‘Show Custom Sidebar Components on All Pages’ is checked
  • Autocomplete for Salesforce allows you to optionally enable Autocomplete for each object.  to do this navigate to Setup > Develop > Custom Settings then select Manage against the Custom Setting called ‘sObjectMap’.  Select the new button, in the Name field enter the three characters at the start of the records ID (e.g. all Account IDs start with 001).  Then in the API Name field enter the Salesforce API name for the object, in this example its Account.
  • Find an Opportunity and select edit and in the Account lookup field start typing the name of an Account, you should see Autocomplete for Salesforce start to suggest some Accounts for you.

Thats it! Any issues with the steps reach out to me on twitter @andymahood__c

Whats next…

Once I am 80% confident that any major issues are identified and under control Autocomplete for Salesforce will be provided on the AppExchange and then very shortly after open sourced on GitHub.

UPDATE @ Wed 14th Nov 19:45GMT: Updated managed package URL with latest version including error handling and printing query execution time for debugging.

UPDATE @ Wed 14th Nov 20:15GMT: Updated managed package URL with latest version including support for inline edit.

UPDATE @ Fri 11th Jan 15:50GMT: Updated managed package URL with latest version including error reporting.

18 Responses to “Autocomplete Lookups for Salesforce”

  1. RemoteAction method and dynamic SOQL?

  2. Nice approach, but (without having tested it), I’m concerned about performance in an enterprise setting. How does this perform with , let’s say, 2 million Account records?

    • I tested this in a full sandbox now. Unfortunately, it’s not performing very well. After typing 2 characters it hangs for up to 30-40 seconds on each key stroke. The two characters I started typing matches appr. 150k Accounts…

      • I had anticipated this being an issue. I am surprise it didnt error as it will be performing a non selective query against the Name field which I do not believe is Indexed.

        I have a couple of ideas for how to accomodate large data sets. Any thoughts of your own would be appreciated also.

  3. Finally tested. We have 6.7 million Accounts and it just hangs. I may still use it for other objects that we have, which have many fewer choices.

  4. I tested Autocomplete (beta 4) for performance. I used the “Create New Opportunity” page and entered (character by character) the word “megabucks”. Here are the query times:

    RUN 1 (Google Chrome, 1st time after install)
    me 57886
    meg 61383
    mega 2052
    megab 2168
    megabu 2011
    megabuc 2069
    megabuck 1992
    megabucks 2007

    RUN 2 (Google Chrome, after refreshing page)
    me 3005
    meg 2014
    mega 1972
    megab 1979
    megabu 1986
    megabuc 2051
    megabuck 2074
    megabucks 2016

    RUN 3 (Google Chrome, after refreshing page)
    me 2682
    meg 2066
    mega 1985
    megab 1972
    megabu 1993
    megabuc 1986
    megabuck 1981
    megabucks 1972

    RUN 4 (Firefox)
    me 2791
    meg 2302
    mega 2080
    megab 2095
    megabu 2027
    megabuc 2058
    megabuck 2222
    megabucks 2006

    Does this help?

  5. Bing Maletz said

    Hi Andy: I tested it in our Sandbox against Account, which has ca 2000 records. The performance is outstanding. We initially wanted to the existing Autocomplete App in Appexchange, with which the lookup list blinks with each key stroke. This component doesn’t have the problem. Could you please kindly let me know how I can deploy it now in production instance?

  6. […] few weeks ago I demoed Autocomplete for Salesforce and showed how it can make lookup fields in Salesforce faster and easier to fill in.  This video […]

  7. I am excited to share that I have turned this project into an AppExchange app. It will be released under a new company called Tapply. The product will be called Autocomplete Lookups for Salesforce and will allow you to search using any field on the related object and display any field as the label in the search results. Find out more at http://tapp.ly/autocomplete/

  8. prayank said

    when i am going for after installing package
    Setup > Customise > Home > Homepage Layouts then edit each layout selected the ‘Autocomplete’ component .

    after installing package .i dont find “AutoComplete” option for check
    Plz help me!

  9. prayank said

    when i am going for after installing package

    Setup > Develop > Custom Settings then select Manage against the Custom Setting called ‘sObjectMap’

    i dont find option for manage custom setting for “sObjectMap” thats why i am not able to click manage for “sobjectMap”

  10. Raunacq R said

    Does this work with the new communities? Ajax is not supported on communities. Importing the connection.js file gives a 404 error

  11. Dee said

    http://tapp.ly/autocomplete giving me error 404. can you please help me to accomplish this requirement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: