CRM 3.0 içerisinde sadece document.getElementById("").style.display = "none" kodu yardımıyla toolbardan bir düğmeyi silmemiz mümkündü.
Bu CRM 4.0 ile çalışmayacaktır. CRM Form'u yüklendiğinde düğme ID'lerinin çalışma anında oluştuğu görülüyor. Bazen bir düğmenin adı ISV_New_1_MyButtonID iken başka bir zaman ISV_New_39_MyButtonID olabiliyor.
Formun OnLoad() event'ine aşağıdaki kodu ekleyerek düğme gizleme işlemini gerçekleştirebilirsiniz.
----
In CRM 3 it was possible to hide a button on a toolbar just by calling the document.getElementById("").style.display = "none" method.
This will NOT work in CRM 4.0. The ID of the button seems to be generated when the CRM Form is loaded. One time it might be ISV_New_1_MyButtonID the other time it might be ISV_New_39_MyButtonID.
To do so use the following javascript in the forms OnLoad event:
HideButton = function()
{
var ULListItems = document.getElementById("mnuBar1").rows[0].cells[0].getElementsByTagName("UL")[0].getElementsByTagName("LI");
for(var i=0; i-1)
{
if (ULListItems[i].id.indexOf("MyButtonID") > -1)
{
ULListItems[i].style.display = "none";
}
}
}
// Form yüklendiğinde kodu çalıştır.
// Execute the function when loading the form.
HideButton();
// Form yeniden yüklendiğinde kodu çalıştır.
// Execute the function when the form is resized.
window.onresize = HideButton;