You need to sign in to do that
Don't have an account?
NagSha
simple Soql query on account
Hi Team.,
this my simple soql query.but my debug is not showing any thing related to contacts and cases.,
public class RelatedList{
public static void subList(){
List<Account> sam =[select id,name ,(Select email from contacts),(Select CaseNumber from cases) from account ];
For(Account a :sam){
System.debug('================values======'+a);
}
}
}
Are you running this in a test method? If so you either need to input test data, or change the @isTest line to: @isTest (SeeAllData=true)
it's not test class.,
I have a trigger on account which calls this methods.,
Can you change your debug statement to
System.debug('================values======'+a.Contacts);
or
System.debug('================values======'+a.Cases);
Let me know if you see anything now?