Sometimes we need to show error message from trigger using add error method. This post is all about what are the challenge i faced to display error message. My requirement is showing error message if an opportunity which is not linked to contact are updated.As we know opportunitycontactrole is junction object which will relate both opportunity and contact. So It is so simple, I went for Opportunity beofore update. trigger OpportunityBeforeUpdate on Opportunity (before update) { OpportynitySequesncecontroller.beforeUpdate(); } public class OpportynitySequesncecontroller { public void static beofeUpdate(){ // others logic are there cos many operation might be there on before update OpportynityManagement .validateOppty(trigger.newmap) } } pub...
A place where you have to land for exploring Salesforce