+ Start a Discussion
northcountrygalnorthcountrygal 

Send email to 4 email addresses using custom Button

I want to send an email to 4 email addresses from a custom button.  

 

I have a custom detail page button, execute javascript that sends email based on the ID and a workflow.  

 

How do I create a button like this to send to email addresses instead?  

 

2 of the email addresses can be referenced from the fields on the object and the other 2 are external email addresses not referenced on the object . . .

 

This is the current code:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")}

var result = sforce.connection.query("Select Id, Send_RTA_Declare_Form__c From PAF__Personnel_Action__c where Id = '{!PAF__Personnel_Action__c.Id}' ");

var records = result.getArray("records");

//alert ( records );

records[0].Send_RTA_Declare_Form__c = true;
result = sforce.connection.update(records);

window.location = window.location;

 

Thanks in advance for any feedback.

 

Marko LamotMarko Lamot

are you asking how to send an email via javascript?

northcountrygalnorthcountrygal

 

I want to send an email using a custom button that uses java script.

Marko LamotMarko Lamot

Hello,

 

see "sendEmail Example" at the bottom of this page: http://www.salesforce.com/us/developer/docs/ajax/Content/sforce_api_ajax_more_samples.htm