You need to sign in to do that
Don't have an account?
RayAllen
Account attachment to trigger a workflow
Hi,
I would like to send out an email alert anytime anyone has added an attachment to an Account. I found the below code on here, but it is specific to an opportunity. Could anyhelp me modify it to work for an Account? I tried changing the obvious (opportunity -> account), but I am not having success. I have created the field 'review_needed' in Accounts in order to match the below code.
Any other hints to help me in this endeavor would be greatly appreciated!
Thanks!
Code:
}
trigger Attachment_Processor on Attachment (after insert) { map<id, opportunity> opps = new map<id, opportunity>(); Opportunity o = null; for(attachment a:[select parentid from attachment where parent.type = 'Opportunity' and id in :trigger.keyset()]){ o = new Opportunity(Id = a.parentid, review_needed__c = true); opps.put(a.parentid, o); } update opps.values();
You can use this code to send mail
This is one way of sending email,
Other can be you can perform a dml action insert or update on any object and send a mail using email alert in a workflow on that object.
All Answers
Use this trigger
I hope above example will help you.
Hi,
Please excuse my ignorance, but I am not sure what to use in place of "Put mail logic here". I am assuming the workflow I would use in order to send the email? How would that look?
I have not done ANY trigger development before and couldn't be newer to this.
Thanks for any additional info you can provide!
You can use this code to send mail
This is one way of sending email,
Other can be you can perform a dml action insert or update on any object and send a mail using email alert in a workflow on that object.
THANK YOU!