+ 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