开发者

Salesforce API: How to retrieve a Case using a partial Case Id

I'd like to retrieve a Case record from the Salesforce API. I only have the beginning of the Case Id (don't ask why) so I've tried the following query:

SELECT Id FROM Case WHERE Id LIKE 'whatever...%'

Unfortunately, this returns the following error:

SELECT Id FROM Case 开发者_运维技巧WHERE Id LIKE '500DABCD...%'
                          ^
ERROR at Row:1:Column:27
invalid operator on id field'
How can we get this functionality from the API?

Why can't I use the LIKE operator on the Id field? Is there some other way I can do this?


I've found a workaround: I've added a custom field to the Case entity that mirrors the Id field. I've found that (unlike the original Id field) I can query this field with the LIKE operator.

The field is of type "Formula (Text)" and I've set the formula to simply be "Id".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜