Display tooltips for fields in MS CRM – Part 3 (for CRM2011)
Last year I blogged twice about how to dynamically create tooltips in MS CRM. Today I want to share with you a post on how to do this in CRM2011 using jQuery and an XML webresource in which you can specify tooltips per entity and fields. The function below reads the xml file and displays a help image and tooltip for each field specified in the xml webresource. (see screenshot).
Step-by-step
First create an XML webresource and give it a descriptive name (e.g. cm_xmlhelpfile).
<help> <entity name="account"> <attribute name="accountnumber"> <shorthelp>This is the SAP accountnumber</shorthelp> </attribute> </entity> </help>
Next add the latest version of jQuery to the webresources and add another webresource to include the function below and call it in the onload event.
//****************************************************
jQueryLoadHelp=function(filename, bDisplayImg) {
/*
This function is used add tooltips to any field in CRM2011.
This function requires the following parameters:
filename : name of the XML webresource
bDisplayImg: bolean to show/hide the help image (true/false)
Returns: nothing
Example: jQueryLoadHelp('cm_xmlhelpfile', true);
Designed by: http://lambrite.com/?p=221
Adaptd by Geron Profet (www.crmxpg.nl)
*/
if (typeof jQuery == 'undefined') {
alert('jQuery is not loaded.\nPlease ensure that jQuery is included\n as webresource in the form load.');
return;
}
$.ajax({
type: "GET",
url: "../WebResources/"+filename,
dataType: "xml",
success: parseHelpXML
}); //end ajax
//****************************************************
function parseHelpXML(data) {
var entity = Xrm.Page.data.entity.getEntityName().toString().toLowerCase();
entXML = $("entity[name=" + entity + "]", data)
$(entXML).children().each(function (i) {
var attr = this.getAttribute("name");
var txt = $(this).find('shorthelp').text();
registerHelp(entity, attr, txt);
});
}
//****************************************************
function registerHelp(entity, attr, txt) {
var obj = document.getElementById(attr+'_c').children[0];
html = '<img id="img_' + attr + '" src="/_imgs/ico/16_help.gif" alt="'+txt+'" width="16" height="16" /><div id="help_' + attr + '" style="visibility: hidden; position: absolute;">: ' + txt + '</div>';
$(obj).append(html);
//20110909 GP: added line to hide/show help image
document.getElementById('img_'+attr).style.display = (bDisplayImg) ? 'inline' : 'none';
}
}
The end result should look something like this:
Thanks to http://lambrite.com for the original design and sharing this.
Related Posts:
Display tooltips for fields in MS CRM – Part 1
Display tooltips for fields in MS CRM – Part 2
Conditionally enable/disable buttons in CRM2011 ribbon
Found this interesting post by (Vikranth Pandiri) about how to conditionally enable/disable buttons in a CRM2011 ribbon based on a value of a field on your form. Instead of using JavaScript you can set these rules directly in the ISV.Config.
See the complete post on howto-mscrm.blogspot.
Outlook 2011 configuration issue
Last week I installed Microsoft Dynamics CRM 2011 for Microsoft Office Outlook and encountered a peculiar issue. The installation went just fine, but when I tried to add an organization within the configuration wizard I received an error message. When I press "Test connection", it worked just fine, but when I press on OK, it keeps giving the message "The server address (URL) is not valid". To fix this, add an extra entry with the server's IP address and servername to the hosts file on your client machine located in "C:\Windows\System32\drivers\etc\hosts". I ran the configuration wizard again and now the organization was added succesfully.
Remarks: This issue will most probably appear when your computer is not part of the same domain as your CRM 2011 server.
Source: http://gustafwesterlund.blogspot.com/2010/12/crm-2011-release-candidate-and.html




