jump to navigation

Microsoft Dynamics CRM 4.0 Hiding taskbar buttons July 22, 2010

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

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’);
if(CreateInvBtn!=null)
            CreateInvBtn.style.display=’none’;

_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’);
if(CreateInvBtn!=null)
            CreateInvBtn.style.display=’inline’;

Enjoy!

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

Advertisements

Microsoft Dynamics CRM 4.0 disabling all fields on a tab July 14, 2010

Posted by jarrettexpertcrm in Microsoft CRM General.
Tags: , , , , , , , , , ,
add a comment

Ever need to disable all fields on a tab not just one or two? Want to know a quick way of doing it instead of crmForm.all.field.disabled = true; for every field? Of coarse you have or you wouldn’t be here :).

Onload

function disableTab(tabIndex)
{
var tab = document.all[“tab” + tabIndex];
for (var i = 0; i < tab.all.length; i++) {
if (tab.all[i].Disabled !== undefined) {
tab.all[i].Disabled = true;
}
}
}
disableTab(2);

Just replace the “2” in disableTab(2) with the proper tab number

Hope this helps!

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

Hiding multiple tabs based on picklist value in Microsoft CRM 4.0 October 5, 2009

Posted by jarrettexpertcrm in Microsoft CRM General.
Tags: , , , , , , , , ,
add a comment

d4 logoBeing able to hide tabs until a certain value is selected in a picklist is becoming a common request. So i decided to post how you can accomplish that. Apply this code on the onload and onchane events (replace with your field names).

if
(crmForm.all.new_fieldname.DataValue == 1)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘inline’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’

}

else if
(crmForm.all.new_fieldname.DataValue == 2)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘inline’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’

}
else if
(crmForm.all.new_fieldname.DataValue == 3)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’

}
else if
(crmForm.all.new_fieldname.DataValue == 4)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’
}

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