You need to sign in to do that
Don't have an account?
S N 27
soql retrieved without querying the requested field while accessing related fields in the for loop
Hi All,
I have an Object called Account_Contact__c that has a field in masterdetail to account named Accounts__c.I am trying to access the Account's owner id in the for loop.
for(Account_Contact__c acn : MyList){
I have a set here that checks for all the account owners.
MySet.contains(acn.Account__r.OwnerId);
}
Is this the correct approach. There is no error while saving the code. But on the UI iam getting the error,"soql retrieved without querying the requested field".
Any help would be highly appreciated.
I have an Object called Account_Contact__c that has a field in masterdetail to account named Accounts__c.I am trying to access the Account's owner id in the for loop.
for(Account_Contact__c acn : MyList){
I have a set here that checks for all the account owners.
MySet.contains(acn.Account__r.OwnerId);
}
Is this the correct approach. There is no error while saving the code. But on the UI iam getting the error,"soql retrieved without querying the requested field".
Any help would be highly appreciated.
For example