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
Gee76Gee76 

Issue with retrieving Id using query()

Hi,

 

I'm using this statement to get record id

 

select id from Site_Sponsorships__c where Name = '" + m_sProgName + "'

 

ID value is retrieved as "a06K0000000xjOaIAI"

instead of "a06K0000000xjOa" ...... Note there is a extra "IAI" at the end.

 

Let me know how to correct this issue.

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
The API always uses the case insensitive 18 character version of the record Ids. You can just strip the last 3 chars if you want the 15 char case sensitive version instead. (search for 15 vs 18 char ids for more info)