【发布时间】:2019-10-28 15:47:00
【问题描述】:
我有一个自定义 salesforce 对象 Installation__c,它有一个自定义字段 Product__c,它是一个自定义对象 Product__c 的查找我正在尝试使用这些查询从子对象中获取字段:
public with sharing class InstallationController {
@AuraEnabled
public static List<Installation__c> getItems() {
// Perform isAccessible() checking first, then
return [SELECT Id, Name, Installation_Display_Name__c, Product__c, Status__c, (SELECT Product__c.Name FROM Product__c) FROM Installation__c];
}
}
我得到错误:
Didn't understand relationship 'Product__c' 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.
我尝试将查询更改为
FROM Product__rand FROM Product__c__r 但似乎都不起作用,我该如何修复我的查询?
【问题讨论】:
-
您需要转到包含查找的对象,并在单击后使用 __r 复制
Child Relationship name名称。
标签: salesforce apex soql