If you're considering a switch from Salesforce to Microsoft, you probably have some questions. For instance, what should you consider from a business planning perspective to ensure your transition is as hassle free as possible?
In complex implementations, we often have very lengthy requirements regarding custom ribbon buttons and when they are enabled and when they are disabled. The challenges of implementing such rules has already been covered in this blog post on enabling and disabling ribbon buttons.
The issue we're going to tackle this time is actually bit more interesting. Sometimes users have problems remembering or understanding why certain ribbon buttons in CRM 2011 are disabled. This can cause a lot of support overhead for power users checking the data and explaining the situation.
(DISCLAIMER: The JavaScript below is unsupported and will most likely not survive an upgrade. This post is intended for academic purposes only, so use at your own risk!)
In our example case, we have multi-step rules on ‘Generate Quote’ button, checking existence of items, fields from other entities, fields from current entity, etc.
Out-of-the-box, disabled ribbon buttons in CRM 2011 will only give a generic message: 'This button is currently disabled. You may not have selected the item that works with this feature. If you do not have permissions to use this feature, contact your system administrator.'
How can we give more information to the user about WHY the button was disabled? Here are some supported ways:
The best way to handle this from usability standpoint would be to modify the existing tooltip to include information about the reason for disabling the button.
The ToolTipDisabledCommandDescription is actually handled at tab level. Changing that will change the look of all disabled buttons. It can be useful for some cases, but does not really help us in this situation. But here is an example anyway:
Adding JavaScript like this:
[sourcecode language="javascript"]Mscrm.RibbonLayout.tabs['EntityTemplateTab.opportunity.NoRelationship.Form.Mscrm.Form.opportunity.MainTab'].FullLayout.children[0].attrs['ToolTipDisabledCommandDescription'] = 'Click some more and it may work?'
Mscrm.RibbonLayout.tabs['EntityTemplateTab.opportunity.NoRelationship.Form.Mscrm.Form.opportunity.MainTab'].FullLayout.children[0].attrs['ToolTipDisabledCommandTitle'] = 'Yep, it is disabled'[/sourcecode]
Will result to the following message (for EVERY disabled button in this form):
So obviously the top part is unique to the button. Maybe best option would be to change that text instead. Below is a simplified function created for this specific button. Note that this example is completely hard-coded for now for a specific group in tab and specific button in group. For actual implementation, the group and button will need to be obtained dynamically.
[sourcecode language="javascript"]setDisabledMessage=function(msg)
{
Mscrm.RibbonLayout.tabs['EntityTemplateTab.opportunity.NoRelationship.Form.Mscrm.Form.opportunity.MainTab'].TabLayout.children[1].children[2].children[0].children[5].attrs['ToolTipDescription'] = msg;
}[/sourcecode]
Now using a
So there you go. More questions about the customizing the ribbon? Refer to our guide on CRM 2011 ribbon customization.
Happy CRM'ing!