Thursday, May 28, 2009

Override the tool tip of the field in Dynamics CRM

there are times when you want to give your users more information into what they should enter into a field.

As widely accepted the tooltips are the most commonly used and convenient way to achieve the same.

In Dynamics CRM you could use scripts to override the tool tip of the field.

Here's the code script to override the tool tip of the field in dynamics CRM:





var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.style.fontFamily = 'Tahoma';
oPopupBody.style.border = '1px solid black';

function showPopupMessage (Tool_Tip_Text)
{
oPopupBody.innerHTML = "
";
oPopupBody.innerHTML += "
" + Tool_Tip_Text +"
";
var X_Coordinate= -100;
var Y_Coordinate= 20;
var width = 350;
var height = 90;
var documentElement = event.srcElement;
oPopup.show(X_Coordinate, Y_Coordinate, width, height, documentElement);
}

//Be sure to attach your OnMouseOver event with the field's caption

crmForm.all.new_customfield1_c.attachEvent('onmouseover', showPopupMessage ("custom tooltip for new_customfield1 "));
crmForm.all.new_customfield2_c.attachEvent('onmouseover', showPopupMessage ("custom tooltip for new_customfield2 "));
crmForm.all.new_customfield3_c.attachEvent('onmouseover', showPopupMessage ("custom tooltip for new_customfield3 "));


Now you can hover your mouse over the field labels to see your custom tooltip popup

No comments: