[SalesForce] Trigger to make Contact Roles required on Opportunities

Is it possible – I have a use case – When a user creates a new opportunity record, they will not be able to save it until they have added one Contact Role. Any Suggestions??

Best Answer

This is a bit of a pain as you can't use a roll up summary field or write a trigger on the OpportunityContactRole object. This is a free, unmanaged, Appexchange product that does this:

https://appexchange.salesforce.com/listingDetail?listingId=a0N300000025Vs1EAE

Note the most helpful negative review:

https://appexchange.salesforce.com/listingDetail?listingId=a0N300000025Vs1EAE&tab=r

The issue is the trigger fires on Opportunity updates so the user will have to cancel out and add a OCR (potentially having to create a Contact first etc).

I have used a modified version of this in combination with a validation rule so that a OCR must be present at a certain stage, but we have actually adopted a different approach. We replaced the New Opportunity screen with a custom VisualForce page that included a section dedicated to making it easy to add an existing Contact as an OCR or creating a brand new Contact all from the same screen.

We decided this was more user friendly as well making all the Opportunities populated with an OCR from the start - so better data quality earlier.

Related Topic