SalesForce API 查询不显示自定义字段
我在 SalesForce 中有一个帐户的自定义日期字段:LastCheckedDate(API 名称:LastCheckedDate__c)
我正在尝试使用 SalesForce Enterprise API 根据该字段查询帐户。它返回结果,我可以在查询的 WHERE 部分使用自定义字段,但我无法让它实际显示结果中自定义字段的值。
此 PHP 代码应该为我提供 2011 年检查过的任何帐户的 ID、名称和 LastCheckedDate:
$query = "SELECT Id,Name,LastCheckedDate__c FROM Account WHERE LastCheckedDate__c > 2011-01-01";
$response = $salesforceConnection->query($query);
foreach ($response->records as $record) {
print_r($record);
}
它正确地仅返回 2011 年检查过的帐户,但结果不包括该自定义字段的值:
stdClass Object
(
[Id] => 0015000000abcdefgh
[Name] => Bob's Widget Factory
)
如何我可以让它在结果对象中包含 LastCheckedDate 吗?
I have a custom date field for accounts in SalesForce: LastCheckedDate (API Name: LastCheckedDate__c)
I'm trying to use the SalesForce Enterprise API to query accounts based on that field. It returns results, and I can use the custom field in the WHERE part of the query, but I can't get it to actually show me the value of the custom field in the results.
This PHP code should get me the ID, name, and LastCheckedDate of any account that has been checked in 2011:
$query = "SELECT Id,Name,LastCheckedDate__c FROM Account WHERE LastCheckedDate__c > 2011-01-01";
$response = $salesforceConnection->query($query);
foreach ($response->records as $record) {
print_r($record);
}
It correctly only returns accounts that have been checked in 2011, but the result doesn't include the value of that custom field:
stdClass Object
(
[Id] => 0015000000abcdefgh
[Name] => Bob's Widget Factory
)
How can I get it to include the LastCheckedDate in the results objects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更新您的 wsdl 文件。因此,您无法选择或更新 wsdl 文件中没有的任何字段。
Update your wsdl file. So You can not select or update any field that are not in the wsdl file.
似乎您遇到了与此问题中解决的相同问题: SalesForce.com :通过PHP检索自定义字段。
这与您如何解析返回的数据有关。
Seems like you are having the same problem as is addressed in this question: SalesForce.com: Retrieve custom fields via PHP.
It is related to how you are parsing the returned data.