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
Eli Flores, SFDC DevEli Flores, SFDC Dev 

the 18 char ID case-insensitivity a lie?

Hi, I was attempting to demonstrate the case-insensitivity of 18 char ID to my peers and I can't seem to get it to work. 

 

I ran this soql query:

select id from account where ID = '0013000000Hk05sAAB'

 

 

which successfully reports 1 record. 

 

When I try the all lowercase version 

 

select id from account where id = '0013000000hk05saab'

 

 

It reports 0 records. 

 

Is this a bug? A limitation of SOQL? Did I misunderstand the case-insensitive nature of 18 char id? I'm confused why the 2nd one pulls up 0 records. 

Best Answer chosen by Admin (Salesforce Developers) 
souvik9086souvik9086

https://success.salesforce.com/questionDetail?qid=a1X30000000KJ03EAG

Check this

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

All Answers

souvik9086souvik9086

It is case in-sensitive. Check with this

 

select id from account where id = '0013000000Hk05saab'

First one is h and second one is H. 

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

Eli Flores, SFDC DevEli Flores, SFDC Dev

That too fails with a 0 records match the query.

souvik9086souvik9086

https://success.salesforce.com/questionDetail?qid=a1X30000000KJ03EAG

Check this

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

This was selected as the best answer
Jaideep BarudJaideep Barud
Hi,

I would like to tell you that 18 char record id in Salesforce are just case-safe and are not Case Insensitive in Salesforce.

So when you query like as you did in your example:
  1. select id from account where ID = '0013000000Hk05sAAB' - will result 1 record
  2. select id from account where id = '0013000000hk05saab' - won't result any record
There is no bug in salesforce. Please refer below mentioned link for reference:
https://help.salesforce.com/apex/HTViewSolution?id=000004383

I hope this will help you with your query.

Regards,
Jaideep (JD)