Disable MS D CRM Form Ribbon Buttons using Java Script on Form Load

Disable MS D CRM Form Ribbon Buttons using Java Script on Form Load.

For Eg. I am trying to disable SAVE , SAVE & NEW , SAVE & CLOSE buttons on Form Load Event

 

function DisableSaveSaveAndCloseSaveAndNewButtons() {

var TelephoneNumber = Xrm.Page.getAttribute(“telephone”).getValue();

if (TelephoneNumber != “” || TelephoneNumber != null) {
//Disable delete button
var Save = top.document.getElementById(“phonecall|NoRelationship|Form|Mscrm.Form.phonecall.Save-Large”);
var SaveAndClose = top.document.getElementById(“phonecall|NoRelationship|Form|Mscrm.Form.phonecall.SaveAndClose-Large”);
var SaveAndNew = top.document.getElementById(“phonecall|NoRelationship|Form|Mscrm.Form.phonecall.SaveAndNew-Medium”);

Save.disabled = true;
SaveAndClose.disabled = true;
SaveAndNew.disabled = true;
Xrm.Page.ui.refreshRibbon();
}
}

 

Cheers,

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s