Microsoft Dynamics CRM4.0 在联系人contact列表上直接发送邮件

Dynamics CRM4.0目前在联系人contact或客户account的列表上有一个直接发送邮件按钮Send direct email,点击后要求选择模版,有客户要求点击后弹出新建邮件的窗口直接输入内容而不是选择模版,以下脚本实现这小功能

 

代码
   
     
< Button Icon ="/_imgs/ico_18_4202.gif" JavaScript ="
var ar=document.all['crmGrid'].InnerGrid.SelectedRecords;
if(ar.length==1){
var url ='';
var strguid='';
var ilist=ar[0][2];
var strlastname='';
var strfirstname='';
var strfullname='';
strguid=ar[0][0];
var nodeselect=document.getElementById('gridBodyTable').childNodes[1].childNodes[ilist].childNodes;
strlastname=nodeselect[4].firstChild.innerText;
strfirstname=nodeselect[3].firstChild.innerText;
strfullname=strlastname + ' ' + strfirstname;
url +='?pId=' + strguid;
url += '&amp;pType=2';
url += '&amp;pName=' + encodeURI(strfullname);
url += '&amp;partyid=' + strguid;
url += '&amp;partytype=2';
url += '&amp;partyname=' + encodeURI(strfullname);
url += '&amp;partyaddressused=';
url += '&amp;contactInfo=' ;
openFrmObj(url, '', 4202);
}
else
{alert('You cannot select more than 1 record at a time. Please select at most 1 record before performing this operation.');
}"
Client ="Web" >
< ToolTips >
< ToolTip LCID ="1033" Text ="Send an E-mail" />
</ ToolTips >
</ Button >

 

如果要加入其它activity类型可采用类似方法,如以下直接创建campaign response 类型的activity

 

代码
   
     
< Button Icon ="/_imgs/ico_18_4401.gif" JavaScript ="
var arc=document.all['crmGrid'].InnerGrid.SelectedRecords;
if(arc.length==1)
{
var urlc ='';
var strguidc='';
var ilistc=arc[0][2];
var strlastnamec='';
var strfirstnamec='';
var strfullnamec='';
strguidc=arc[0][0];
var nodeselectc=document.getElementById('gridBodyTable').childNodes[1].childNodes[ilistc].childNodes;
strlastnamec=nodeselectc[4].firstChild.innerText;
strfirstnamec=nodeselectc[3].firstChild.innerText;
strfullnamec=strlastnamec + ' ' + strfirstnamec;
urlc += '?partyid=' + strguidc;
urlc += '&amp;partytype=2';
urlc += '&amp;partyname=' + encodeURI(strfullnamec);
urlc += '&amp;partyaddressused=';urlc += '&amp;contactInfo=' ;
openFrmObj(urlc, '', 4401);
}
else
{
alert('You cannot select more than 1 record at a time. Please select at most 1 record before performing this operation.');
}"
Client ="Web" >
< ToolTips >
< ToolTip LCID ="1033" Text ="Campaign Response" />
</ ToolTips >
</ Button >

 

 

 

你可能感兴趣的:(Microsoft)