locked
Ribbon Workbench mscrm2011 RRS feed

  • Question

  • Hi,

    Based on my field selection in case form i need to disable the custom buttons which i have created using ribbon workbench.

     here i am taking some custom  rule and by using that rule i have created one webresource with function name nd using that i am calling that function in enable rules in workbench.

    My Jscript code as

    function refreshRibbonOnChange()
    {
        Xrm.Page.ui.refreshRibbon();
    }

    function enableButton()
    {
    var formType = Xrm.Page.ui.getFormType();
     
               if (formType != 1) {
      var attribute = Xrm.Page.getAttribute("fmc_casenumber");
      if (attribute!=null)
    {
    return (attribute.getValue()==true);
    }
    else
    {
    return true;
    }
    }
    }

    i have tried with this code but it is not wrkng

    Can u plz help me out

    Regards,

    hiteksha


    • Edited by hiteksha Thursday, March 6, 2014 1:53 PM
    Thursday, March 6, 2014 1:52 PM

All replies

  • Not working means is it always returning false so that the button is always disabled?

    Or is it throwing any error?

    Is your fmc_casenumber attribute is Two Options? (Because its value is compared against true)

    Make sure your button is triggering the function, try to add "alert" in the function before everything.

    function enableButton()
    {
    alert("enableButton function");
    var formType = Xrm.Page.ui.getFormType();
    .....................
    .....................


    Friday, March 7, 2014 2:36 AM