ValueRule - Enable the Custom button only when a specific filed on the form has a value.
For example, if the 'Email' field has value then the custom will be enable otherwise it will disable.
/RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/
EnableRule for mulitple fields, use 'OrRule', for example
EnableRule only works with Equal(=) condition, for different conditions (not equal) use 'InvertResult' attribute.
Refer the above id in the following location /RibbonDiffXml/CommandDefinitions/CommandDefinition/EnableRules
CustomRule - call a javascript function based on the result.
http://msdn.microsoft.com/en-us/library/gg334317.aspx
http://msdn.microsoft.com/en-us/library/gg328073.aspx
http://msdn.microsoft.com/en-us/library/gg309433.aspx
For example, if the 'Email' field has value then the custom will be enable otherwise it will disable.
/RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/
<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
<ValueRule Field="email" Value="null" InvertResult="true"/>
</EnableRule>
<ValueRule Field="email" Value="null" InvertResult="true"/>
</EnableRule>
EnableRule for mulitple fields, use 'OrRule', for example
<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
<OrRule>
<Or>
<ValueRule Field="email" Value="null" InvertResult="true"/>
</Or>
<Or>
<ValueRule Field="leadsourcecode" Value="810520005"/>
</Or>
</OrRule>
</EnableRule>
<OrRule>
<Or>
<ValueRule Field="email" Value="null" InvertResult="true"/>
</Or>
<Or>
<ValueRule Field="leadsourcecode" Value="810520005"/>
</Or>
</OrRule>
</EnableRule>
EnableRule only works with Equal(=) condition, for different conditions (not equal) use 'InvertResult' attribute.
Refer the above id in the following location /RibbonDiffXml/CommandDefinitions/CommandDefinition/EnableRules
<EnableRule Id="Sample.account.form.CheckFaxValue.EnableRule"/>
CustomRule - call a javascript function based on the result.
<EnableRule Id="DNS.contact.form.EmailValue.EnableRule">
<CustomRule FunctionName="DisableReportButton" Library="$webresource:dns_JavaScript/reports.js" Default="true" />
</EnableRule>
<CustomRule FunctionName="DisableReportButton" Library="$webresource:dns_JavaScript/reports.js" Default="true" />
</EnableRule>
http://msdn.microsoft.com/en-us/library/gg334317.aspx
http://msdn.microsoft.com/en-us/library/gg328073.aspx
http://msdn.microsoft.com/en-us/library/gg309433.aspx