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
moverdorfmoverdorf 

OpenActivities...Please help!.. At my witts end with this!

I run the following:

 

List<Account> lstactivity = new List<Account> ([

SELECT (SELECT

         ActivityDate,

         Description,

         Subject,

         IsClosed,

         CallType,

         CallDisposition,

         Status,

         ActivityType

        FROM OpenActivities

        

        )

FROM Account

]

);

 

 

I get back the following when I System.Debug(a.OpenActivities):

 

21:36:28.082 (82119000)|USER_DEBUG|[107]|DEBUG|(OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6cJMAQ, ActivityDate=2012-11-15 00:00:00}, OpenActivity:{IsClosed=false, Status=Not Started, Description=The Advisory Tiered Payout Rate for this Advisor has just changed., AccountId=001A000000nSc9XIAS, Subject=Adv Payout Tier Rate Change, ActivityType=1_, Id=00TA000000og6c9MAA, ActivityDate=2012-11-15 00:00:00})

 

I want to loop through the OpenActivity Sobject and get the values of the fields.

Can anyone please tell me the SYNTAX for how I can retrieve the fields within the OpenActivity SObject?

 

Thanks soooo much for any help I am at a loss!

Satish_SFDCSatish_SFDC
Duplicate : http://boards.developerforce.com/t5/General-Development/Please-help-at-my-witts-end-with-this/m-p/682081

Loop through the Accounts and in an inner loop, iterate over the OpenActivities.

for(Account a : lstactivity){
for(OpenActivity t : a.OpenActivities){
System.debug(t.Subject);
}
}

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Hope this helps.
Regards,
Satish Kumar