0
    I am trying to query the relationship "Assigned_To__r" within the "Case" object, so I can return the Name of the User that is currently assigned to the case.I have tried many different syntaxes, and read many different web pages on this, but can't seem to figure it out. Here is my current syntax that isn't working, but as I said, I've tried many different combinations 
Please help.


`select Id,CaseNumber,Subject,(select Name from Assigned_To__r) 
from Case 
where Closure_Code__c <> 'Invalid Support Case' 
and Closure_Code__c <> 'Duplicate Case' 
and Closure_Code__c <> 'Spam''

これは私が得ているエラーです:

INVALID_TYPE: CaseNumber,Subject,(Assigned_To__r から Name を選択) from Case where ^

行:1:列:48 のエラークエリ呼び出しの FROM 部分の関係 'Assigned_To_r' を理解できませんでした。カスタム関係を使用しようとしている場合は、必ずカスタム関係名の後に「_r」を追加してください。適切な名前については、WSDL または記述呼び出しを参照してください。

4

1 に答える 1

0

SOQL にフォーマットの問題がいくつかあります。

Assigned_To__cカスタム フィールドが とどのように関連しているかを明確にしていただければCase、問題の解決方法が少し明確になります。ただし、あなたの状況に対する私の最善の推測に基づいて (具体的にClosure_Code__cは、 は標準の選択リストでAssigned_To__rあり、 のカスタムの子から親への関係フィールドCaseです)、希望する SOQL は次のようになると思います。

SELECT Id, CaseNumber, Subject, Assigned_To__r.Name
  FROM Case
 WHERE Closure_Code__c NOT IN ('Invalid Support Case', 'Duplicate Case', 'Spam')
于 2012-01-31T08:19:04.610 に答える