Thursday, 21 April 2016

Getting Form

How to get a form

function controlFormRibbon() {
   var formLabel;
   var currForm = Xrm.Page.ui.formSelector.getCurrentItem();
   formLabel = currForm.getLabel();

   //this code to show the ribbon if only the current opened form is Partner,
   //otherwise remain disable/hidden
   if (formLabel == "Partner") //change this with your own specific form name
      return true;
      return false;
   //you can also apply the different/reverse rule here, for example you want to hide if form is Partner

No comments:

Post a Comment