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 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;
}
}
Menoo te Koppele has posted an article on free CRM Auditing, I have not reviewed these tools but they seemed to be priced well.

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