WeDid: Contact Role Validation


When the Opportunity is updated to Stage =  ‘Shipping Confirmed’, only one of the following contact role must exist within the opportunity:

1. Supplier Contact Role
2. Purchaser Contact Role

Currently, the Administrator needs to run through a report for Opportunities – with ‘Shipping Confirmed’ stage. For each record, the Administrator will check to verify that only one of the above contact roles and not more than that appear in the Opportunity.

If the Opportunity does not have the correct Contact Role specified, they need to notify the Opportunity owner include/remove the contact roles. This verification has to be done on a daily basis and is time consuming. Automation was required to reduce the level of manual effort needed.



  • To automate the verification of the Opportunity Contact Role when opportunity stage is ‘Shipping Confirmed’.
  • Trigger ensures that Opportunity owners insert the correct number of contact roles.
  • An error message will be displayed when the incorrect number of contact roles is selected.
  • Saves the Administrator time from checking each record.


Related Objects Opportunity
Components Apex Trigger
Complexity Simple