function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nick @ AKCSLNick @ AKCSL 

Account Record IDs

I've downloaded the C# Partner sample from http://prdownloads.sourceforge.net/sforce/csPatnerSample_with_source.zip?download

If I query the Account object as follows:

Select Id, Name from Account where id = '00120000000ibRPAAY'

I correctly get the result :

00120000000ibRPAAY AK Computer Services

However, if I use the query :

Select Id, Name from Account where id = '00120000000ibRP'

I get the same result!

(The "=" is not masquerading as a "like", since

Select Id, Name from Account where id = '00120000000ibR'

returns no records)

The reason I ask is that I have downloaded an excel Add-in to allow our users to query Account IDs and add them to a custom field on the Leads object in SalesForce. This add-in uses xmlrpc, api version 2.0 from the login server www.salesforce.com to query the data. It returns a 15 character Id from the Accounts table.

I want to use this custom field to match Leads to Accounts. My app is in C#.NET using our enterprise WSDL, and this correctly returns an 18 character Id from the Account object.

Why/How does the C# Partner sample match both the 15 and 18 character Id to the same record?

Cheers

Nick

ScotScot

Nick,

Both 15 character and 18 character ids are accepted for the SOAP API calls; they are equivalent values to salesforce.com.

The 15 character key is case sensitive; it can be used by both the API and the URL's. The additional three characters produce a case independent value, for use by tools like Excel and Access, which don't respect case when sorting or performing table lookups.

All environments other than the API still only deal with 15 character values (reports, backup extracts, XMLRPC, and the URL's for the HTML interface.

Converting from 18 to 15 is easy, just chop off the trailing 3. Converting the other way can also be done; examples of C, Java, and Visual Basic are available.

For more into, search on '18 char' and pick the highest ranking entry, by "malm", or go to
http://forums.sforce.com/sforce/board/message?board.id=JAVA_development&message.id=738, and then walk down that thread.

Scot

Nick @ AKCSLNick @ AKCSL

Thanks Scot,

that explains what's going on.

I didn't manage find that other thread when I was looking for a solution.

Cheers

Nick