【问题标题】:Relational SOQL in Salesforce PatronManagerSalesforce PatronManager 中的关系 SOQL
【发布时间】:2011-11-07 16:47:03
【问题描述】:

我正在尝试使用 Salesforce API(使用自定义 PatronManager 对象)构建应用程序,当我运行以下“父对子”查询时,我收到一条错误消息,指出无法理解该关系:

SELECT Name, (SELECT PatronTicket__InstanceDate__c FROM PatronTicket__EventInstance__r) FROM PatronTicket__TicketableEvent__c

但是,当我反转它并运行“子到父”查询时,它可以完美运行:

SELECT PatronTicket__InstanceDate__c, PatronTicket__TicketableEvent__r.Name FROM PatronTicket__EventInstance__c

谁能解释为什么父子查询给我一条错误消息?

谢谢!

斯科特

其他信息

我将 PHP Toolkit 与 Enterprise WSDL 一起使用,但收到以下错误消息:

Fatal error: Uncaught SoapFault exception: [sf:INVALID_TYPE] INVALID_TYPE: PatronTicket__InstanceDate__c FROM PatronTicket__EventInstance__r) ^ ERROR at Row:1:Column:57 Didn't understand relationship 'PatronTicket__EventInstance__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. in /home/scott/public_html/salesforce-test/salesforce/soapclient/SforceBaseClient.php:782 Stack trace: #0 [internal function]: SoapClient->__call('query', Array) #1 /home/scott/public_html/salesforce-test/salesforce/soapclient/SforceBaseClient.php(782): SoapClient->query(Array) #2 /home/scott/public_html/salesforce-test/aupac-enterprise.php(16): SforceBaseClient->query('SELECT Name, (S...') #3 {main} thrown in /home/scott/public_html/salesforce-test/salesforce/soapclient/SforceBaseClient.php on line 782

【问题讨论】:

    标签: salesforce soql


    【解决方案1】:

    我是 Patron Technology 的 Michelle。您可以直接联系我们的客户服务部门吗?使用 PatronManager CRM 帮助选项卡中的“支持”链接。您尝试这样做真是太棒了,我很乐意进一步讨论。

    我有一个简单的“暂时”答案给你(你需要使用 PatronTicket_EventInstances_r 复数,而不是 Instance),但我也想更详细地讨论这个问题,因为从技术上讲Salesforce API 不完全支持访问自定义对象(因此我们的自定义对象不一定完全使用 API)...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-17
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      相关资源
      最近更新 更多