CRM 2011 Ribbon DisplayRule ValueRule not working

I'm currently trying to show / hide a custom ribbon button based on the value of a checkbox in a form.

I managed to get my XML to work fine with the <EnableRule>i created , but as soon as I try to use <DisplayRule>this button disappears, no matter what value I put in the field new_is_trading.

Here is my XML below:

        <CommandUIDefinition>
          <Group Id="Mscrm.Form.account.CustomGroup.Group" 
                 Command="Mscrm.Form.account.CustomGroup.Command" 
                 Title="Client Commands" 
                 Sequence="51" 
                 Template="Mscrm.Templates.Flexible2">

              <Controls Id="Mscrm.Form.account.CustomGroup.Controls">
              <Button Id="Mscrm.Form.account.CustomGroup.Button.A" 
                      Command="Mscrm.Form.account.CustomGroup.Button.A.Command"
                      Sequence="10" 
                      LabelText="Custom Button" 
                      ToolTipTitle="Description" 
                      ToolTipDescription="Should only be shown if this account is trading" 
                      TemplateAlias="o1" 
                      Image16by16="/_imgs/ribbon/CustomEntity_16.png" 
                      Image32by32="/_imgs/ribbon/CustomEntity_32.png" />
            </Controls>
          </Group>
        </CommandUIDefinition>

Then in my rule definitions:

    <RuleDefinitions>
      <TabDisplayRules />
      <DisplayRules>
        <DisplayRule Id="Mscrm.Form.account.CustomDisplayRules.DisplayIfClient">
          <ValueRule Field="new_is_trading" Value="true" />
        </DisplayRule>
      </DisplayRules>
      <EnableRules>
        <EnableRule Id="Mscrm.Form.account.CustomEnableRules.EnableIfClient">
          <ValueRule Field="new_is_trading" Value="true" />
        </EnableRule>
      </EnableRules>
    </RuleDefinitions>

Again, mine EnableRuleworks fine, but mine DisplayRulefor some reason doesn't work!

+3
source share
2 answers

Use 1 (true) and 0 (false) to compare boolean values ​​- this will work. I have the same problem.

+4
source

, , , . value, , , , ...

    <CommandDefinitions>
      <CommandDefinition Id="Mscrm.Isv.account.grid.ShowMap.Command">
        <EnableRules>
          <EnableRule Id="Mscrm.Isv.account.Clients.EnableRule" />
          <EnableRule Id="Mscrm.Isv.account.grid.OneSelected.EnableRule" />
        </EnableRules>
        <DisplayRules>
          <DisplayRule Id="Mscrm.Isv.account.Clients.DisplayRule" />
        </DisplayRules>
        <Actions>
          <JavaScriptFunction Library="$webresource:way_showBingMapAll.js" FunctionName="showBingMap" />
        </Actions>
      </CommandDefinition>
    </CommandDefinitions>
-1

All Articles