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
Kondal Rao learnerKondal Rao learner 

urgent pls on trigger

Hi expert,


1.       Create a trigger on External Review object
2.       Whenever the status is “Review Submitted” trigger should fire and pick the Owner from the related opportunity(Lookup on External Review) and send a notification to Proposal Owner
 pls how to do that

You cant do this using a workflow and email alert?


Try this


trigger sendNotification on ExternalReview__c(after insert,after update){
Map<ID,ExternalReview__c> oppMap = new Map<ID,ExternalReview__c>([SELECT id,,Opportunity__r.Owner.Email FROM ExternalReview__c WHERE id in]);
	for(ExternalReview__c exRev:{
		if(exRev.status == 'Review Submitted'){
			String ownerEmail = oppMap.get(;
			Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

			String[] toAddresses = new String[] {ownerEmail};

			mail.setSubject('Notification Email : ' +[0].Name);

			mail.setPlainTextBody('Owner of Opportunity: ' + oppMap.get(;
			mail.setHtmlBody('Owner of Opportunity: <b>' + oppMap.get(;

			Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });


If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.