
if(op.Sample_Hypo__c == true){
Olist.add(op);
System.debug('Olist'+Olist);
}
}
update Olist;}elseSystem.Debug('There is no contact associated with Opportunity');}catch(DmlException e){System.Debug(e.GetMessage());}}}
3 respuestas
Hi Anvesh, It will show you opportunites related to contact as you have mentioned Contact_Name__r.id =:ContactId in your query. and second thing -you are doing DML , which is not required. update Olist;// not requiredSameer