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

Validating Opportunity Contact Roles

I need to validate that the contact chosen on for an Opportunity Contact Role belongs to the same Account that related Oppty belongs to. It seems that validation rules and triggers are not possible on Contact Roles. Is there anybody that can get me started?




You have rightly mentioned trigger and validation rules cannot be implemented on "Contact Role", you can perhaps implement your custom visual force page for creating contact role and as you will be using code to generate the contact role records , you can do it after conducting the necessary validations.

Sales force pages developer guide has an example which shows how contact role Opportunity and Contact can be generated through code under the heading "Creating a Wizard". For your reference the API name of Contact Role is "OpportunityContactRole".