Nov 24, 2011

Defining DisplayRule for buttons

I have shown in my previous post how to enable/disable a ribbon button according to defined criteria. Assume that we need to make it visible/invisible depending on the same rule. This is also possible with a little change of XML. Get defined our own display rule instead of enable rule. Define and call under Displayrules tag instead of Enablerules tag. Please check below code. (Please refer previous post for relevant CustomActions tag entry.)
<CommandDefinition Id="Cmd_CUSTOM_CompanyFunction">
    <EnableRule Id="Mscrm.AvailableOnForm" />
    <EnableRule Id="Mscrm.CanSavePrimary" />
    <DisplayRule Id="DR_CUSTOM_CompanyCustomer" />
  <Actions />

  <TabDisplayRules />
    <DisplayRule Id="DR_CUSTOM_CompanyCustomer">
      <ValueRule Default="false"

No comments:

Post a Comment