开发者

Salesforce.com Id attribute seems to have a 15 and 18 character value, whats the difference?

开发者 https://www.devze.com 2023-01-06 10:20 出处:网络
When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database is Id.Well there seems to be two representations of this value as either a 15 charac

When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database is Id. Well there seems to be two representations of this value as either a 15 character version or a开发者_高级运维n 18 character version.

I have been using the 18 since it is clearly more specific, but what is contained in the last three digits, that they can be dropped, seemingly?

Anyone understand what this is all about?


From the Web Services API Developer's Guide:

ID fields in the Salesforce.com user interface contain 15-character, base-62, case-sensitive strings. Each of the 15 characters can be a numeric digit (0-9), a lowercase letter (a-z), or an uppercase letter (A-Z). Two unique IDs may only be different by a change in case.

Because there are applications like Access which do not recognize that 50130000000014c is a different ID from 50130000000014C, an 18-digit, case-safe version of the ID is returned by all API calls. The 18 character IDs have been formed by adding a suffix to each ID in the Force.com API. 18-character IDs can be safely compared for uniqueness by case-insensitive applications, and can be used in all API calls when creating, editing, or deleting data.

If you need to convert the 18-character ID to a 15-character version, truncate the last three characters. Salesforce.com recommends that you use the 18-character ID.


I know this is an old post, but just in case it is useful to someone...

If you want to do ad-hoc conversions of Id's, rather than programatically, then this Chrome extension makes it easy: https://chrome.google.com/webstore/detail/sf-15-to-18/cogllpmaoflgaekieefhmglbpgdgmoeg

FYI - I'm the developer. Please use the feedback form on the app if you'd like to suggest any improvements or additional functionality.

Thanks!

0

精彩评论

暂无评论...
验证码 换一张
取 消