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

Roolup summary using Trigger
Hi every one,
i have one scenario we wont to write trigger account and contact will have lookup relation ship if contacts will added automatically in the account object one custom field count will be increse (like lookup relation ship)
how can we acchive this if any one know please help me.
Thank you
Surender Reddy
9603757105
i have one scenario we wont to write trigger account and contact will have lookup relation ship if contacts will added automatically in the account object one custom field count will be increse (like lookup relation ship)
how can we acchive this if any one know please help me.
Thank you
Surender Reddy
9603757105
1. You can use roll-up helper App Exchange product to count the number of contacts on Account.
https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009i3UpEAI
2. You can write a trigger on contact to update the number of contacts on Account.
Trigger countContacts on Contact(After insert,After delete){
// logic goes here
}
Thanks,
SEKAR RAJ
Greetings to you!
Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Try this code:
Trigger: Trigger Handler: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi