title: Ribbon button value rule depending on statecode value
body: <p>I added a new custom button to quote form ribbon. This button should only appear, if the statecode is active (<a href="http://msdynamicscrmblog.wordpress.com/2013/10/26/status-and-status-reason-values-in-dynamics-crm-2013/comment-page-1/" rel="nofollow">Value: 1</a>).</p>
  
  <p>I created following CommandDefinition: </p>
  
  <pre><code>&lt;CommandDefinition Id="mySolution.quote.Form.MyButton.Command"&gt;
      &lt;EnableRules /&gt;
      &lt;DisplayRules&gt;
          &lt;DisplayRule Id="mySolution.QuoteIsActive" /&gt;
      &lt;/DisplayRules&gt;
      &lt;Actions&gt;
          &lt;JavaScriptFunction FunctionName="myFunction" Library="$webresource:new_myLibrary" /&gt;
      &lt;/Actions&gt;
  &lt;/CommandDefinition&gt;
  </code></pre>
  
  <p>And following DisplayRule:</p>
  
  <pre><code>&lt;DisplayRule Id="mySolution.QuoteIsActive"&gt;
      &lt;ValueRule Field="statecode" Value="1" Default="true" /&gt;
  &lt;/DisplayRule&gt;
  </code></pre>
  
  <p>But if I use this DisplayRule my button never appears. If I remove the rule from CommandDefinition the button is always visible.</p>
  
  <p>I also tried to use 'Active' as value (as shown at the bottom of this <a href="http://www.experts-exchange.com/Software/Microsoft_Applications/Microsoft_Dynamics/Q_26949090.html" rel="nofollow">post</a>, with the same result.</p>
  
  <p>What is the trick to define a rule depending on statecode? Or did I miss something?</p>