function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MarellaMarella 

Opportunities roll up to all Contact Roles

Hi All,

I had a requirement of adding the oppporunity amount to all of its contact roles. if the contact role added the opportunity, the amount of opportunity has be added to a field "Achieved" on contact Object. The contact might be a contact role on multiple opportunities. If the contact role has been removed from td the opportunity, the respective amount to be subtracted from Achieved field of Opportunity object.

Please do let me know how can i get the solution. I appreciate all of your responses with code or any recommendations.

 

Thanks,
Veeru

sfdcfoxsfdcfox

The problem here is that you can't trigger on OpportunityContactRole, so you can't do this in real-time. I would probably suggest a VF page so when you view the contact, it can show you the sum. If you need this in a report, you're going to have a rough time getting this data.

Cathy PostmusCathy Postmus
Rollup Helper from Passage Technology can help with this. There's a free version which will enable you to rollup from Contact Role to Opportunity level on a scheduled basis (every hour, every day, etc).
Also, if you pay for Rollup Helper, as part of their support, Passage Technology will create for you a Foreign Key Trigger (FKT) or a Visualforce Page Trigger (or you could just write your own) which will basically enable "real-time" rollups.  I have found Passage Technology to be an awesome company when it comes to support. They are amazing!