Since the OpportunityContactRole object is not a first class object you cannot create a trigger on the object, nor add fields or create a validation rule. Is it possible to prevent the deletion of an opportunity contact role record that is inserted during lead conversion and marked as primary using a trigger? I need to identify an opportunity contact role record that is created during lead conversion and marked as primary and prevent that record from being deleted and lock it down.
-
Winter20 now supports triggers on OCR – cropredy Sep 10 '19 at 0:38
I think the only workaround is to change your business process to use a custom lookup field on Opportunity to fulfill your primary contact functionality. When users modify the lookup field, an opp trigger can create / modify the appropriate opportunity contact role record.
Of course there's still no good way to deal with the situation where a user deletes the opp contact role, but at least the lookup field value will remain, plus you can use field history tracking on it.