1

I have to update Opportunity custom field when OpportunityContactRole Primary checkbox is update.My understanding is there is no trigger for OpportunityContactRole as we need to vote it here .I read some workaround here Onview Trigger on Opportunity Contact Roles .But how about if OpportunityContactRole is inserted or update from DataLoader?How to detect the field change and update it to Opportunity custom field?

2

One solution that I will suggest is to use the batch apex for this. The batch would take all the OpportunityContactRole records from the system, check who is the primary contact and based on that, update the opportunity object field. You may also compare the values you have stored on the opportunity object record and pick only those who are changed.

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.