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
NarenKNarenK 

Difference between UserInfo.getOrganizationId() and Organization.Id

What is the difference between UserInfo.getOrganizationId() and Organization.Id.

 

I am expecting them to  return same organizationId. But both of them returning different values. 

 

UserInfo.getOrganizationId() returning 3 additional characters than Organization.Id.

 

Any help in this really appreciated.

 

Regards,

Naren

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Salesforce ids are 15 characters in the UI, but apis return an 18 character case-insensitive version.

 

There's more details at:

 

http://stackoverflow.com/questions/3213470/salesforce-com-id-attribute-seems-to-have-a-15-and-18-character-value-whats-the

All Answers

bob_buzzardbob_buzzard

Salesforce ids are 15 characters in the UI, but apis return an 18 character case-insensitive version.

 

There's more details at:

 

http://stackoverflow.com/questions/3213470/salesforce-com-id-attribute-seems-to-have-a-15-and-18-character-value-whats-the

This was selected as the best answer
NarenKNarenK

Thank you