You need to sign in to do that
Don't have an account?
Pranav T'iwary
Account and Contact has the lookup relationship now i want the rollup type of filed in the Account page where i can show the count of my all contacts. I cannot change the relationship from Lookup to master- Detail.
Account and Contact has the lookup relationship. Now i want the rollup kind type of field in the Account page where i can show the count of my all contacts. I cannot change the relationship from Lookup to master- Detail.
How i will achieve this in the Account page in lookup relationship ?
How i will achieve this in the Account page in lookup relationship ?
HI Pranav,
Create roll-up summary fields on:
1.Any custom object that is on the master side of a master-detail relationship
2.Any standard object that is on the master side of a master-detail relationship with a custom object
3.Opportunities using the values of opportunity products related to the opportunity
4.Accounts using the values of related opportunities
5.Campaigns using campaign member status or the values of campaign member custom fields
So cannot make the roll up the summary with contacts.
You can achieve this through the trigger. Below is the link.
Please follow the link steps.
You could also use something like this which looks to completely solve the issue:
https://ericsantiago.com/2009/12/11/contactscases-rollup-for-accounts-in-salesforce/
Please choose my answer as the best answer.if that's helps you.
Thanks,
Harshit Garg
harshitgarg2591@gmail.com
All Answers
You need a AFTER INSERT , AFTER UPDATE trigger on contact to achieve this.
Refer the following posts for more information.
http://blog.jeffdouglas.com/2009/07/30/roll-up-summary-fields-with-lookup-relationships-part-1/
https://developer.salesforce.com/forums/?id=906F0000000g0q1IAA
Hope this helps.
HI Pranav,
Create roll-up summary fields on:
1.Any custom object that is on the master side of a master-detail relationship
2.Any standard object that is on the master side of a master-detail relationship with a custom object
3.Opportunities using the values of opportunity products related to the opportunity
4.Accounts using the values of related opportunities
5.Campaigns using campaign member status or the values of campaign member custom fields
So cannot make the roll up the summary with contacts.
You can achieve this through the trigger. Below is the link.
Please follow the link steps.
You could also use something like this which looks to completely solve the issue:
https://ericsantiago.com/2009/12/11/contactscases-rollup-for-accounts-in-salesforce/
Please choose my answer as the best answer.if that's helps you.
Thanks,
Harshit Garg
harshitgarg2591@gmail.com
Please find the below code and and update according to senario,in this trigger i used custom object, you just need to replace the same with your desired object which you want to use
Apex Trigger : Apex Class :
This trigger also work on deletion of record and reparitng the parent of child, in both cases it will the child count.
Hope this help!
Thanks
Pranav