Salesforce.com Record IDs Enlightenment for Everyman


By Alan Shanahan – Principal Technical Architect for Astadia Consulting.

Are you using the full force of your Salesforce.com? Believe it or not, Record IDs can help if you’re not!

Apart from being what many regard as long, useless numbers; Record IDs in Salesforce.com can in fact be very useful, whether you’re a simple user of the system, or an advanced developer looking to extend your Force.com applications.

Each table and data record in the Salesforce.com system has a unique ID field assigned to it. You can’t remove the unique ID, nor can you change it; it’s something that is system generated each time a new record is inserted into the application. Unique IDs are in fact very useful for anyone designing and developing applications on the Force.com platform. To understand this better let’s look at a real example:

  • As an exercise, sign into your Salesforce.com org and find an Account record to work with (In my case, I am using a developer org with some test data pre-loaded)
  • I’ve selected the Edge Communications account, which has an ID of 001A0000006Vm9u as you can see from the page snippet below

Salesforce.com Unique ID


So why are these IDs useful?

Basically, they provide a consistent, foolproof way to refer to a data record; right down to the ability to copy and paste a unique ID as a URL into the page address after the salesforce.com/ part of the address.

What many do NOT know is that these IDs, though unique, are also case-sensitive. This can present a challenge when you are using the ID values in external systems such as MS Excel or database systems.

To demonstrate my point, try this URL: http://na7.salesforce.com/001A0000006VM9U

(substitute the na7 part of the URL for your own instance)

It almost certainly will not work, and you’ll see an error message (unless, by some fluke this ID actually exists in your system). To drive home the point, 001000000009Abc is *not* equal to 001000000009ABC, at least not in Salesforce.com ID terms.

Useful information: Record ID values are copied without modification from a production org when a sandbox is created, but it is almost certain that any subsequent records created in the two orgs will have different ID values.

Now, you can do some interesting things with ID values. For example, the following characters (entered after the salesforce.com part of the web address) will place you in a new Contact record page: /003/e – Try it!

Similarly, these characters will navigate you directly to the Campaign Home Page: /701/o

Using just the 3-char prefix will bring you to the default view for that object e.g. /800

Entering a known record ID (15 or 18 characters) will direct you straight to the details page of that record: /00QA0000004wjDt

Here are some more useful shortcuts:

Useful tip: The 1st 3 characters of an ID indicate the object type (i.e. table name)

  • 001 = Account
  • 003 = Contact
  • 005 = User
  • 006 = Opportunity
  • 00D = Organization
  • 00e = Profile
  • 00E = UserRole
  • 00Q = Lead
  • 00T = Task
  • 00U = Event
  • 012 = Record Type
  • 015 = Document
  • 01t = Product
  • 500 = Case
  • 701 = Campaign
  • 800 = Contract… and so on

These prefixes never change for standard objects. Custom objects are assigned 3-char prefixes based on internal SFDC rules that we cannot predict. However, even if you’re not a developer or an expert user of Salesforce.com, these unique IDs can provide a quick route to locate and amend data in the Salesforce.com system. Not only that, it’s also quite a fun way to show how much you know about the system and how quickly you can navigate around it.

For those of you who are a bit more technical, my next blog post will go into the 15 or 18 character IDs in more detail…

Advertisements

6 Responses to “Salesforce.com Record IDs Enlightenment for Everyman”


  1. 1 Osmar June 17, 2010 at 4:56 pm

    This is great article! As a developer I’m always keen to learn new tips and tricks. Looking forward to part 2 – When is that being posted?

    • 2 astadiaemea June 17, 2010 at 4:58 pm

      Hi,
      Glad you liked it! The follow up will be up on Monday next week. Keep me posted if you have any questions! It’s always good to hear from readers!
      Many thanks,
      Alan.

  2. 3 Phil Rogers June 18, 2010 at 9:39 am

    Very useful article – the joy of true Cloud computing is that any of the salesforce.com subscribers can learn and benefit from tips and articles like this one.
    Keep up the good work!

  3. 4 Stephen Bellhouse June 23, 2010 at 9:13 am

    Alan,
    A very useful and well written article.
    Thanks for sharing your knowledge.
    Appreciate it!
    Stephen


  1. 1 15 or 18 Character IDs in Salesforce.com – Do you know how useful unique IDs are to your development effort? « Astadia EMEA's Blog Trackback on June 21, 2010 at 4:47 pm

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s




Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 28 other followers

Astadia EMEA on Twitter

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Our Authors

Previous Blog Posts


%d bloggers like this: