function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
amritamrit 

How to remove bcc value in javascript

Hi,

 

 Im trying to send email template to three email ids in lead page  using javascript

.I have created a custom button named'Send email'

.There are three email fields in lead page 1)Email 2)Email_Other__c 3) Email__c.

 

Email should be displayed in 'to' field  ,Email_Other__c in cc ,Email__c in bcc field.

If the three email fields are filled then email id will display in corresponding fields.If first email field (Email)is ony filled and other two fields are blank ,Then Email field is displaying  to and bcc field. I want to display the first email id in 'to' field if Email_Other__c and Email__care blank.

 

{!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/16.0/apex.js")} 
var v=new sforce.SObject("Lead"); 
v.id = "{!Lead.Id}"; 
var e='{!Lead.Email}';
var e1='{!Lead.Email_Other__c}'; 
var e2='{!Lead.Email__c}'; 

if(e1.value== '' && e2.value== '' && e.value!='' ){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4=&p5=','_self',false) 
} 
else if(e1.value!= '' && e2.value== ''){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4={!Lead.Email_Other__c}&p5=','_self',false) 
} 
else if(e2.value!= '' && e1.value== ''){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4=&p5={!Lead.Email__c}','_self',false) 
} 
else{ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4={!Lead.Email_Other__c}&p5={!Lead.Email__c}','_self',false) 
}

 Please help me to resove the issue

 

Thanks

cplusplus_pleasecplusplus_please

Try this

 

{!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/16.0/apex.js")} 
var v=new sforce.SObject("Lead"); 
v.id = "{!Lead.Id}"; 
var e='{!Lead.Email}';
var e1='{!Lead.Email_Other__c}'; 
var e2='{!Lead.Email__c}'; 

window.open ('
https://na15.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4=' + e1 + '&p5=' + e2 + '&p24=' + e)

 

 

=============================
Developer for www.voicent.com
Voicent provides CRM, auto dialer, predictive dialer, reminder, and call center solution that is suitable for anyone in any level
Voicent strives to meet customer demands to integrate Voicent software with CRM of their choice.