If you have taken a good look at the 'Actions' menu in Microsoft CRM 4.0, you will see that it is a list of all the things you can do. This is great, in some cases, but catastrophically bad in others. Take the 'Cases' form, see below :
The first thing that struck me when I looked at this was, Oh No!
e.g
The user goes to resolve a case and accidentally hits the delete option instead! I know that there is (mercifully) a check dialogue immediately afterwards, but why is this option there anyway? In a well run organisation, I cant think of a single reason why you would want to delete a case anyway!
So, how do we remove it?
Well, this isnt any way of altering the underlying code, so we have to do this with Javascript in the OnLoad event, but first, we need to find the 'id' of the element in the code. If you 'view source' on the page, you will see that 'Delete Case' is part of a list element [LI] and it's ID is _MIonActionMenuClickdelete112. So, by pasting the following code into the OnLoad event :
//*****************************************************************************
//This code will remove the 'Delete Case' option from the drop down 'Actions' menu
//******************************************************************************
//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('id') == '_MIonActionMenuClickdelete112')
{
//Replace the DHTML with blank tags to hide the button
lis[i].outerHTML='<SPAN></SPAN>'
}
i = i + 1;
}
we get this....
Done.
Alternatively, this will do the same thing...
//DEACTIVATE MENU ITEM if (document.all._MIonActionMenuClickdelete112 != null)
{ document.all._MIonActionMenuClickdelete112 .style.display = "none"; }
Recent Comments