You need to sign in to do that
Don't have an account?
Navneeth
How to send email notification after attachment attached to Account object.
I want to send email notification to user, through trigger or any other way, as soon as the attachment is attached to record in Account object.
you should write the trigger
trigger TiggerName on attachment (after insert)
{
....
}
Hi,
you should write a trigger like below
trigger triggerName on Attachment (after insert) {
Set<Id> accIds = new Set<Id>();
Set<Id> userIds = new Set<Id>();
for (Attachment attach : Trigger.new){
if (acc.ParentId.getsObjectType() == Account.sObjectType){
accIds.add(attach.ParentId);
}
}
if (!accIds.isEmpty()){
for (Account acc : [SELECT Owner FROM Account WHERE Id IN:accIds LIMIT 100]){
userIds.add(acc.Owner);
}
// write you stuff here
}
}
go through this documentaion for email swnding in apex:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_email_outbound.htm
your trigger should be on attachment object after insert , you should check the object type once this satisfies your criteria fire the emails using email code.
thanks,
Try this.
This will help you in sending emails.
PS: was written on a notepad can have syntax errors