You need to sign in to do that
Don't have an account?

Help Bulkifying roll up summary Trigger
Hi
I am pretty new to apex and have had a good few goes at trying to get my head around bulkyfying this trigger. I know I need to use a map & an aggregateresult loop but just cant seem to get the syntax right.
any help appreciated
for(Course_Application__c c:Trigger.new) { Course__c c = [select id, Confirmed_applications__c from Course__c where Id =:c.id]; Integer u = [select Count() from Course_Application__c where course_del__r.Id =:crsId and status__c='Ordered']; c.Confirmed_applications__c=u; update c; }
thanks
les
used this in the end
All Answers
I hope the follwowing code will help you!.
Thanks,
George
Visit my blog here
hi
sorry it's taken a while to respond. I have had to tidy up a few bits but I get an error, 'illegal assignment from LIST <Course__c> to MAP <Id,Course__c>' relating to the line in bold
used this in the end