我使用 SELECT 查询从 Salesforce.com 下载联系人。正如下面给出的,我收到“MALFORMED_QUERY”例外

发布于 2024-10-06 09:44:10 字数 406 浏览 1 评论 0原文

我使用这个选择查询,但我不明白这有什么问题。

选择 ID、联系人.名字、联系人.姓氏、联系人.职务、联系人.部门、联系人.生日、 联系电话、联系电话、联系电话、联系电话、联系电话、其他电话、联系传真、联系电子邮件、联系邮寄街道、 联系方式.MailingCity、联系方式.MailingState、联系方式.MailingCountry、联系方式.MailingPostalCode、联系方式.OtherStreet、 Contact.OtherCity、Contact.OtherState、Contact.OtherCountry、Contact.OtherPostalCode、Contact.Description、Contact.Account.Name 来自联系人,其中 strcmp('%@',Id) = -1",lastcontactId

I use this select query and i am not getting what's the wrong with this.

Select Id,Contact.FirstName,Contact.LastName,Contact.Title,Contact.Department,Contact.Birthdate,
Contact.Phone,Contact.HomePhone,Contact.MobilePhone,Contact.OtherPhone,Contact.Fax,Contact.Email,Contact.MailingStreet,
Contact.MailingCity,Contact.MailingState,Contact.MailingCountry,Contact.MailingPostalCode,Contact.OtherStreet,
Contact.OtherCity,Contact.OtherState,Contact.OtherCountry,Contact.OtherPostalCode,Contact.Description,Contact.Account.Name From Contact where strcmp('%@',Id) = -1",lastcontactId

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故人爱我别走 2024-10-13 09:44:10

您需要生成一个使用 = 的查询,例如

select name from contact where id='005123123123123123'

,您可以使用它来生成查询。

NSString *query = [NSString stringWithFormat:@"select name,etc from contact where id='%@'", lastContactId];

这是 SOQL 文档有更多的例子。

如果您尝试进行分页,则应该运行整个查询并使用 query/queryMore 来分页结果。

You need to generate a query that uses =, e.g.

select name from contact where id='005123123123123123'

so, you can use this to generate the query.

NSString *query = [NSString stringWithFormat:@"select name,etc from contact where id='%@'", lastContactId];

Here's the SOQL docs which has more examples.

And if you're trying to do paging, you should just run the entire query and use query/queryMore to page through the results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文