function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Trigger mailSend on Order(after insert){ List<Order> ordList = new List<Order>();//parent obj set<Id> ordIds=new set<Id>(); for(Order ord: trigger.new){ ordIds.add(ord.id); } //Relationship query to get opportunity user Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); string[] toAddress = new string[]{}; mail.setTargetObjectId(targetobjectid); toAddress.add(owner.email); //opportunity owner email (select owner.email from opportunity) system.debug('toAddress :'+toAddress); mail.setSaveAsActivity(false); mail.setToAddresses(toAddress); //System.debug( mail.setTargetObjectId); mail.setTemplateId(et.id); mail.setToAddresses(toAddress); Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); } }
Is it that you want to send an email notification whenever a new order record is inserted or do you want to send the email at regular intervals?
can you elaborate on the scenario and the issue you are facing so as to check and respond appropriately.
Looking forward to your response.
Thanks.
NOTE: The code provided is an example. You'll need to review and make modifications for your organization.
Let me know if it helps