Ribbon Workbench value rule on grid only work if column is on grid

0
61
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


Hello,

I am trying to enable/display a smart button on the main gird (view)  of a table (entity).

I want it to be enabled if the selected row has certain criteria met.

I found that when using the value rule in the ribbon workbench this only works if the grid (view) has all the columns (fields) in the condition.

I tried to use a custom enable rule using the following code but it will not return the true value back to ribbon workbench to enable the button

CheckForecastView: function (selectedItems) {
  var gridContext = selectedItems[0].Id;
  var retVal = false;
  Xrm.WebApi.retrieveRecord(“msdyn_customerasset”, gridContext, “?$select=a, b, c”).then(
  function success(result) {
    var a = result.a;
    var b = result.b;
    var c = result.c;
    if(a !== 809700000 && b !== 1 && (c === “SA” || c === “SA13”)) {
      retVal = true;
    }
    else {
      retVal = false;
    }
  return retVal;
  });
},



Source link

Leave a reply

Please enter your comment!
Please enter your name here