不理解字段路径中的关系 'opportunity__c'。
Didn't understand relationship 'opportunity__c' in field path.
Select id, Account.Type from opportunity__c
我创建了一个自定义对象机会并在 Account__c 和帐户数据类型查找上建立关系,但上面的查询没有 运行 并给出以下错误
"Select id, Account.Type from opportunity__c
^ ERROR at Row:1:Column:12 Didn't understand relationship 'Account' in field path. 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."
听起来帐户是一个自定义字段,在这种情况下,该字段称为 account__c,关系称为 account__r,因此您的查询应该是 select id, account__r.type from opportunity__c
当您尝试在 SOQL 中访问通过查找或主从关系链接的字段时,您必须放置后缀“__r”而不是“__c”。
对于您的情况,请尝试:
Select id, Account__r.Type from opportunity__c
Select id, Account.Type from opportunity__c
我创建了一个自定义对象机会并在 Account__c 和帐户数据类型查找上建立关系,但上面的查询没有 运行 并给出以下错误
"Select id, Account.Type from opportunity__c ^ ERROR at Row:1:Column:12 Didn't understand relationship 'Account' in field path. 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."
听起来帐户是一个自定义字段,在这种情况下,该字段称为 account__c,关系称为 account__r,因此您的查询应该是 select id, account__r.type from opportunity__c
当您尝试在 SOQL 中访问通过查找或主从关系链接的字段时,您必须放置后缀“__r”而不是“__c”。
对于您的情况,请尝试:
Select id, Account__r.Type from opportunity__c