You need to sign in to do that
Don't have an account?
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!
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