最初のコントローラー拡張機能を作成しようとしていますが、エラーが発生しています:
エラー: コンパイル エラー: フィールド式の最初の用語は具体的な SObject である必要があります: 行 26 列 34 の LIST
これはエラーを生成したコードです:
public class CustFinAcctRelatedList{
private households__Household__c RG;
private List<households__HouseholdMember__c> RGMembs;
private List<Account> Accts;
private List<Financial_Account__c> finAccts;
//Get Household Record from VisualForce Page//
public CustFinAcctRelatedList(ApexPages.StandardController controller) {
this.RG = (households__Household__c)controller.getRecord();
}
public List<Financial_Account__c> getFinAccts()
{
//Get Household Members (junction object between Account and Household) from Household//
RGMembs = [
SELECT id, households__Household__c, households__Account__c
FROM households__HouseholdMember__c
WHERE households__HouseholdMember__c.households__Household__c = :RG.id
];
//Get Accounts from Household Members (junction object between Account and Household)//
Accts = [
SELECT id
FROM Account
//****THE FOLLOWING LINE IS CAUSING THE ERROR****//
WHERE Account.id IN :RGMembs.households__Account__c.id
];
//Get Financial Account from Accounts//
finAccts = [
SELECT id, name, Client__r.name, Current_Value__c, Account_Type__c
FROM Financial_Account__c
WHERE Financial_Account__c.Client__c IN :Accts.id
];
return finAccts;
}
}
このエラーが生成される理由は何ですか?
返されたデータを使用して、Visualforce ページにカスタム関連リストを作成します。
ありがとう!