How to write a rollup summary trigger for a lookup relationship

Is there anyway to update a rollup summary field with lookup relation ship for a custom object. How can we achieve this using triggers ?

Answer

https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries

The above link from Abhinav solves your problem

If you need for more than one object would recommend to try the excellent tool from Andrew

http://andyinthecloud.com/2013/07/07/new-tool-declarative-rollups-for-lookups/

And if you have requirement for only one object ,you can prefer jeff solution as well

http://blog.jeffdouglas.com/2009/07/30/roll-up-summary-fields-with-lookup-relationships-part-1/

Attribution
Source : Link , Question Author : Salesforce developer , Answer Author : Mohith Shrivastava

Leave a Comment