soap - Salesforce.com Id 属性似乎有 15 和 18 个字符的值,有什么区别?

标签 soap salesforce apex-code

当使用 SOAP API 与 salesforce.com (SFDC) 一起工作时,底层数据库中的主键似乎是 Id。好吧,这个值似乎有两种表示形式,要么是 15 个字符的版本,要么是 18 个字符的版本。

我一直在使用 18,因为它显然更具体,但是最后三位数字中包含什么,它们似乎可以删除?

有谁明白这是怎么回事?

最佳答案

来自 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.

关于soap - Salesforce.com Id 属性似乎有 15 和 18 个字符的值,有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3213470/

相关文章:

web-services - 使用 SOAP 读取 XML 文件值并提交到 Web 服务

java - 作为 Web 服务客户端的 Netbeans 富客户端平台 RCP 应用程序

C#/Salesforce : Must Constrain Generic, 无法约束通用

dynamic - 如何内省(introspection) APEX 中变量的类?

salesforce - 如何在 Visualforce 页面上仅显示从自定义验证中提取的错误消息?

salesforce - 当测试类中 seeAlldata = false 时,如何创建具有系统管理员配置文件的用户

web-services - 使用 Web 服务从后台检索应用程序时,如何解决 Windows Phone 8 应用程序中的错误?

.NET SOAP 常见类型

javascript - Salesforce 服务控制台中的自动全局搜索

salesforce - 获取 Apex 中 Blob/String 的大小(以字节为单位)?