Great script for hiding buttons on forms, this can be used for both custom buttons or out of the box buttons. Code is from DMCRM and can be found here.
onload
//Get all of the List Elements
var lis = document.getElementsByTagName('LI');
var i = 0;
//Loop through the list items
while (i < lis.length) {
//Don't worry about any list item that doesn't have the title you are looking for.
if (lis[i].getAttribute('title') == 'Qualify or disqualify the lead')
{
//Replace the DHTML with blank tags to hide the button
lis[i].outerHTML='<SPAN></SPAN>'
}
i = i + 1;
}
Update: The “Messages” associated with an entity control the tags, be sure you make these updates after updating the messages.
I did this once a while back for a client and may need to do it soon again on my current client. I found this blog entry while looking at another entry on the MSCRMBLOG.net site.
![]()
A very interesting method of using a button to hide an entire section from MSCRMBLOG.net. I am thinking of a great way to use this method to hide several 1-many sections that are linked in an IFRAME.

I had this issue when installing MS Outlook and attempting to use the CRM Client. This solves the error received when the client isntall claims that Outlook isn’t set as the default Email program. This article is by Joel Mansford and is titled MS Dynamics CRM 4.0 Client Configuration Wizard Fails With “Outlook Is Not Set As The Default Mail Client On Windows Server 2008 X64”
Great article by Ross Lotharius at Ascentium titled “Multi-tenancy and the Default Organization, What is it and how do I set it for users?” which provides information on supporting users and setting default organizations in CRM 4.0.
I have been looking for a script that will hide the entire left navigation bar in MSCRM 4.0. for a custom entity. I found this forum response here and it works well!
document.all.crmNavBar.parentElement.style.display = "none"; document.all.tdAreas.colSpan = 2;
Here are a couple of great scripts for formatting phone numbers in CRM 4.0 that were posted as a responses to the East Region Microsoft CRM Blog.
/* This code formats the phone number, allowing up to a 5 digit extension to be displayed on the same line. The following code example shows how to format basic U.S. phone numbers. This method supports 7-digit and 10-digit numbers, for example, (410) 555-1212.*/
// Get the field that fired the event.
var oField = event.srcElement;
// Validate the field information.
if (oField.DataValue != "undefined" && oField.DataValue != null)
{
// Remove any nonnumeric characters.
var sTmp = oField.DataValue.replace(/[^0-9]/g, "");
// If the number has a valid length, format the number.
switch (sTmp.length)
{
case "4105551212".length:
oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) + "-" + sTmp.substr(6, 4);
break;
case "5551212".length:
oField.DataValue = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
break;
case "41055512121".length:
oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,1);
break;
case "410555121212".length:
oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,2);
break;
case "4105551212123".length:
oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,3);
break;
case "41055512121234".length:
oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,4);
break;
case "410555121212345".length:
oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,5);
break;
}
}
—-
/* This code formats the phone number, The following code example shows how to format basic U.S. phone numbers. This method supports 7-digit and 10-digit numbers, for example, (410) 555-1212.*/
// Get the field that fired the event.
var oField = event.srcElement;
// Validate the field information.
if (oField.DataValue != "undefined" && oField.DataValue != null)
{
// Remove any nonnumeric characters.
var sTmp = oField.DataValue.replace(/[^0-9]/g, "");
// If the number has a valid length, format the number.
switch (sTmp.length)
{
case "4105551212".length:
oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) + "-" + sTmp.substr(6, 4);
break;
case "5551212".length:
oField.DataValue = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
break;
}
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 