开发者

Customise a control in dynamics crm

开发者 https://www.devze.com 2023-01-22 21:13 出处:网络
I\'ve written code that can make a phone dial a number from a function call, that\'s done and dusted.

I've written code that can make a phone dial a number from a function call, that's done and dusted.

What I would like to achieve is adding a Dial button to each phone number field on the forms in Dynamics CRM. Eventually this could also create a new phone record fill in the basic det开发者_C百科ails and show it to the user to enter notes and an outcome for the phone call, and perhaps some other workflow bits to schedule the next call.

Can I put a custom control on a standard form in place of the standard control. I'm assuming it would have to be an IFrame to an asp.net page, that pulls in the record id, and the field name, looks up the number to show in a text box, and passes the number to the DialNumber function. Hey presto...

I assume its not going to be that easy... Has anyone tried this before, what's the process, what are the gotchas?


I solved this very problem by putting some html(divs and anchors) over the telephone fields. The below code puts a phone icon on the end of the textbox for the given field.

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*/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号