You need to sign in to do that
Don't have an account?

Help needed: custom button to fire email template and update status
Hello all,
Long time lurker, first time poster. I'm trying to create a custom button for my lead view that will:
1. Fire an email template to a lead
2. Update a status field
3. Return the user to the lead view
Here's what I've got so far - it fires the template but does NOT update the status. Can someone point me in the right direction?
location.replace('/email/author/emailauthor.jsp?p2_lkid={!Lead.Id}&retURL=%2F{!Lead.Id}&template_id=00X40000001B4fY&{!URLFOR($Action.Lead.Edit, Lead.Id, [retURL=URLFOR($Action.Lead.View, Lead.Id), lea13_ileinner ="First email and call attempt made", save=1] )}')
Much appreciated!
Christopher S. Penn | cspenn@gmail.com
Read: www.ChristopherSPenn.com
Engage: www.BlueSkyFactory.com
Listen: www.MarketingOverCoffee.com
Attend: www.PodCampBoston.org
Take a look at the custom button example for the REQUIRESCRIPT function.
The example uses the Case object, but can be refactored for Lead.
Hope that helps,
Sati
The good news is that this refactored script now changes status.
The bad news is that this refactored script no longer sends mail.
Script:
You could remove the portion to send an email, and then use workflow rules to send the email. So once the status field is updated, it will trigger an email alert to the lead using your desired template.
Hope that helps,
Sati
Ah, but the goal is to have one button do it all.
Is there any way based on your experience to fit that first line of code which previously worked into that large block of status stuff?
With workflow, one button will do it all. Once you click the button, the field will be updated. In the background, the workflow rule will catch the change and automatically send out the email alert. Give it a try and you'll see.
Best,
Sati
True to a certain extent. I appreciate the original intent as wf emails do not show on activity history for the record....this may be critical for the customer activity management and actions review on any object. If you got it working would love to see the final code...
Regards,
Quique