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

I have to count a child records on parent object by using trigger
Hi All,
I have a two objects like doctor(parent) and patient(child), my scenario is i have to count a child records on parent object by using trigger.
(using rollup summary we can achieve this but i have to achieve with trigger)
please any one help me with code for this scenario.
Thanks in advance!!!
I have a two objects like doctor(parent) and patient(child), my scenario is i have to count a child records on parent object by using trigger.
(using rollup summary we can achieve this but i have to achieve with trigger)
please any one help me with code for this scenario.
Thanks in advance!!!
http://www.sundoginteractive.com/sunblog/posts/rollup-summary-with-a-lookup-field-salesforce
http://cloudskc.wordpress.com/2012/05/25/custom-roll-up-summary-field-via-apex/ (http://www.sundoginteractive.com/sunblog/posts/rollup-summary-with-a-lookup-field-salesforce)
All Answers
http://www.sundoginteractive.com/sunblog/posts/rollup-summary-with-a-lookup-field-salesforce
http://cloudskc.wordpress.com/2012/05/25/custom-roll-up-summary-field-via-apex/ (http://www.sundoginteractive.com/sunblog/posts/rollup-summary-with-a-lookup-field-salesforce)
This will update corresponding parent from the child records every time when an event is fired on child object.