jump to navigation

Microsoft Dynamics CRM 4.0 Hiding taskbar buttons July 22, 2010

Posted by jarrettexpertcrm in Microsoft CRM General.
Tags: , , , , , , , , , , , ,

In many occasions you may need to hide a task bar button on a form, lucky for you i’m going to show you how. Im also going to show those of you that do not know how to use the developer tool bar to grab the name of the button you are wanting to hide. In this example i am going to hide the “Create Invoice” button on the Order.  First open an exsisting order and press ctrl N. You now have the option to go to your developer tool bar. Upper right hand corner click tools, then developer tool bar.

 Once the dev toolbar has finished loading go to find, select element by click. Put your mouse over the button you want to hide, you will notice a blue outline over the button. Click that button and the properties of that button come up on your dev toolbar. Look for you button and you will see the ID for it.  You can hide the button in many different scenarios but for a simple example i am just going to hide it when the form loads. Place the following code onload.

var CreateInvBtn=document.getElementById(‘_MBprocessOrder’);

_MBprocessOrder is the ID of the button i am hiding in this example, for those that are hiding a different button replace that with your button ID. When you want to have the button show again use the following code:

var CreateInvBtn=document.getElementById(‘_MBprocessOrder’);


For more information about Dynamics Four or to contact us please visit http://www.dynamics4.com



1. Ralf Ramackers - February 9, 2011

Does not work, button is still visible. And I get an error when closing the form.

Ralf Ramackers - February 9, 2011

The code you posted only works in CRM 3.0…

jarrettexpertcrm - March 24, 2011

No it works in 4.0 as well, thats where i used it.

jarrettexpertcrm - March 24, 2011

Can you provide me with the code you are using and a screen shot of the error

2. Matt Johnson - March 20, 2012

I had the same problem when I copy & pasted the code from this page. You have to type the code into your OnLoad page. It looks like the ‘ character is incorrect.

var CreateInvBtn = document.getElementById(‘_MBprocessOrder’);
if(CreateInvBtn != null)
CreateInvBtn.style.display = ‘none’;

Hope this helps :o)
Great piece of work by the way cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: