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"; }
Microsoft CRM 4.0 and CSS Styling
Further to the excellent post HERE by Stunnware, I just wanted to add my $0.10 worth.
CRM uses CSS styling to achieve much of the look and feel of the application. Therefore, it stands to reason that you can change this look and feel to suit yourself. Well, yes and no, so here goes.
Obligatory Warning : This is an unsupported customization. If you wish to do what I have done, I suggest you take a backup of the relevant files for reference. Also, as Stunnware has pointed out, future upgrades and hotfixes may not be applied correctly once you begin customizing the core files so take a backup anyway if you intend to keep your changes. This way, you can always change back temporarily to accommodate a hot fix and then re-install the sliced/diced file when you are ready.
Proof of Concept
Is it in fact possible to change the look and feel of Dynamics?
Judge for yourself....
Well, yes is the answer and by the way (Yech!)
How do you change the Look and Feel?
Well, Stunnware has suggested that you change the individual styling of the classes and paste this into the <head> section of Homepage.aspx under the _root folder. This is fine, but all those classes have to be held somewhere. Well, they are...
Check out wwwroot\_grid\AppGrid.css.aspx (see below)
{{.ms-crm-List-Data{behavior: url(/_static/_grid/appgrid_defaultdata.htc);.ms-crm-ListArea{.ms-crm-List-DataBody{HEIGHT:100%;.ms-crm-List-DataBodyEx{HEIGHT:auto;.ms-crm-List-DataArea{OVERFLOW-X:auto;OVERFLOW-Y:auto;/*background-color: #FFFFFF;*/.ms-crm-List-DataAreaEx{OVERFLOW-X:auto;behavior: url(/_static/_grid/rowsbeforescrolling.htc);.ms-crm-List-RefreshButton{.ms-crm-List-RightMarker{.ms-crm-List-Paging{a.toolbarbutton{{{{{{{{{.ms-crm-List-Header{.ms-crm-List-DataColumnHeader{.ms-crm-List-Row{.ms-crm-List-DataCell{{.ms-crm-List-ResizeBar{behavior: url(/_static/_grid/columnresize.htc);{{.ms-crm-List-Index{behavior: url(/_static/_grid/appgrid_jumpbar.htc);.ms-crm-List-IndexItem{.ms-crm-List-SelectedIndex{.ms-crm-List-DefaultIndex{}.ms-crm-List-Message{padding:1;COLOR: #999999;behavior: url(/_static/_grid/appgrid_defaultdata.htc);.ms-crm-List-PreviewLabel{behavior: url(/_static/_forms/styles/mouseover.htc);.ms-crm-List-Spacer{TD.previewData{behavior: url(/_static/_forms/styles/mouseover.htc);TD.previewDataNum{behavior: url(/_static/_forms/styles/mouseover.htc);TD.previewDataDatetime{behavior: url(/_static/_forms/styles/mouseover.htc);SPAN.previewDirSpan{behavior: url(/_static/_forms/styles/mouseover.htc);.ms-crm-List-PreviewRow{.ms-crm-List-Preview{.ms-crm-List-PreviewCell{TR.ms-crm-List-SelectedRow{SPAN.gridLui{IMG.ms-crm-Lookup-Item{IMG.ms-crm-Lookup-PresenceItem{{.ms-crm-List-StatusBar-Label{nobr.num{nobr.datetime{So, rather than adding the following to the Homepage.aspx page as suggested in this article which is technically fine.
<script language="JavaScript">var nobr = nobrElements[index];nobr.style.textAlign = "right";You need to add the following to AppGrid.css.aspx instead.
{/*Added by XXX 17/07/2008 - Alligns numbers - right*/In my opinion, this method is much neater because you can keep all of your customizations in one place. You can remove the customizations very easily by renaming your cut and shut file to BAK and renaming your backup file to it's original designation. You dont have to interfere with the underlying code of the Homepage.aspx.
Posted at 02:58 PM in CRM Configuring, CRM Development, CRM General, Javascript Snippets, Personal Comment | Permalink | Comments (0) | TrackBack (0)
Digg This | Save to del.icio.us