2つのオブジェクトと、データを取得するための単純なクエリがあります。
ccList
デバッグ出力に従って配列に格納されるクエリの結果は次のとおりです。
(
CustomThree__c:
{
Name=cusmei3 2,
customOne__c=a005000000IwnOPAAZ,
Id=a025000000FsFGQAA3
},
CustomThree__c:
{
Name=cusmei3 1,
customOne__c=a005000000IwnOUAAZ,
Id=a025000000FsFGLAA3
}
)
あなたが見ることができるようsystem.debug(ccList[0])
にリターン:
CustomThree__c:{
Name=cusmei3 2,
customOne__c=a005000000IwnOPAAZ,
Id=a025000000FsFGQAA3
}
しかしId
、配列(または他のフィールド)から取得しようとすると、エラーが発生します。誰かが私が間違っていることを指摘できますか?
コード
Object[] ccList;
ccList = [SELECT id, name, CustomOne__r.name FROM CustomThree__c];
system.debug(ccList);
system.debug('******************************************');
system.debug(ccList[0]);
system.debug(ccList[0].Id); //this one cause the error