ttajic
4/1/2016 - 11:00 AM

SetVisibility, Disable/lock field

SetVisibility, Disable/lock field

var adacta = adacta || {};

adacta.setVisibility = function (fieldName, visible) {
	var field = Xrm.Page.getControl(fieldName);
	if(field === undefined || field == null)
	{
		return;
	}
	field.setVisible(visible);
}

adacta.setDisabled = function (fieldName, disabled) {
  var field = Xrm.Page.ui.controls.get(fieldName);
  if (field != null)
  {
     field.setDisabled(disabled);
  }
}