【问题标题】:Customise a control in dynamics crm在动态 crm 中自定义控件
【发布时间】:2010-11-02 11:26:20
【问题描述】:
我已经编写了可以让电话从函数调用中拨出号码的代码,这已经完成并且已经尘埃落定了。
我想要实现的是在 Dynamics CRM 表单上的每个电话号码字段中添加一个拨号按钮。最终,这还可以创建一个新的电话记录,填写基本详细信息并将其显示给用户输入笔记和电话结果,也许还有一些其他工作流程位来安排下一次通话。
我可以在标准表单上放置一个自定义控件来代替标准控件吗?我假设它必须是一个到 asp.net 页面的 IFrame,它会拉入记录 id 和字段名称,查找要在文本框中显示的数字,并将数字传递给 DialNumber 函数。嘿,快...
我认为它不会那么容易......以前有没有人尝试过这个,过程是什么,有什么陷阱?
【问题讨论】:
标签:
asp.net
custom-controls
customization
dynamics-crm
dynamics-crm-4
【解决方案1】:
我通过在电话字段上放置一些 html(div 和锚点)解决了这个问题。下面的代码在给定字段的文本框末尾放置了一个电话图标。
crmForm.ApplyClickToDial= function(field, href){
var phoneField = field;
phoneField.style.position = "relative";
var imgAnchor = document.createElement("a");
phoneField.appendChild(imgAnchor);
imgAnchor.href=href;
imgAnchor.style.position = "absolute";
imgAnchor.style.right = ".5em";
imgAnchor.style.top=".5em";
var image = document.createElement("img");
image.src ="/_imgs/ico_16_4210.gif";
imgAnchor.appendChild(image);
}
var mobileNumber = crmForm.all.mobilephone.DataValue;
crmForm.ApplyClickToDial(crmForm.all.mobilephone_d, "http://callphone/" + mobileNumber ); /* the "_d" represents the control's encompassing td element*/