function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NagShaNagSha 

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);
         }

    }

}

SLockardSLockard

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)

NagShaNagSha

it's not test class.,

 

I have a trigger on account which calls this methods.,

vishal@forcevishal@force

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?