Posted by : XRM Consultant Saturday, 17 September 2011

Hey Guys,

I am currently developing a CRM system in 2011 for one of our biggest clients. One of the requirements is to create editable lists which i have decided is best handled by creating holding entities for this information. For example, creating an entity to hold marketing sources allows easier reporting across selected sources and allows the marketing team to manage the list (adding new ones and deactivating unused ones). The problem with this is that to add a value to this it involves opening a whole CRM form which isn't the best. So, for these entities I don't display the left-navigation options and i wanted to minimize the Ribbon.

However, this wasn't as easy as it sounds…

First of all, having scoured the SDK i could see plenty of examples of how to add or hide BUTTONS on the ribbon and even (via other blogs) remove the ribbon itself, but nothing that would minimize the ribbon allowing it to be expanded if needed.

So after a conversation with the very helpful xRM Mike and reading another post by the excellent Rhett Clinton I used the following:

window.top.document.getElementById("minimizeribbon").fireEvent("onclick");




However, still didn't work…..



Reason being, that the Ribbon seems to be one of the last things to Load in the form, loading after the OnLoad events have fired. So, i needed to add a timeout to wait before firing the script and it worked a treat! Final code ended up as:



function toggleRibbonbar()
{
var t=setTimeout("toggleRibbon()",0);
}
function toggleRibbon()
{
window.top.document.getElementById("minimizeribbon").fireEvent("onclick");
}



Which gave the following results:



image



A big thanks to Rhett, Mike and as always the other CRM Legend that is Rob P



Ta



xRM Consultant

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Search This Blog

Popular Post

About xRM Consultant.com

Having worked with Microsoft Dynamics CRM 4.0 in a sales & development environment, my focus now is on customising this awesome solution and showing its true potential.
Powered by Blogger.

- Copyright © xRM Consultant -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -