CRM 2011 Ribbon DisplayRule ValueRule check for null
Asked Answered
T

2

6

Quick one, I don't see any direct answers out there so I thought I'd ask. (Here is the same question asked on the microsoft social site and it is unanswered as well)

If I have a DisplayRule and a ValueRule in that, how can I check for null? This suggested solution below apparently doesn't work (according to the linked question):

  <DisplayRule Id="new.incident.form.IsNotRelatedToY.DisplayRule">
    <ValueRule Field="YId" Value="null" InvertResult="true" />
  </DisplayRule>

Does it depend on the type of Field? If so I need it to work in two seperate cases, when YId is an entity reference, and also when YId is a string. I figure "null" cannot work for a string, because "null" is a valid string.

Anyone have a working example?

EDIT: it looks like the ValueRule documentation has nothing on the subject.

Tailor answered 8/5, 2012 at 19:18 Comment(0)
A
7

Good question, but unfortunately I don't think there's any good answer here because I think it's a bug. If you use "null" as the value for a string attribute in a ValueRule for an EnableRule, you'll see that the button in fact becomes enabled (or disabled depending on what you set for InvertResult). It just doesn't work for DisplayRules. (My best guess is they just put more effort into developing EnableRules instead of DisplayRules; as mentioned in your link, there's no support for CustomRules for DisplayRules either, though it exists for EnableRules.)

I'd file a bug report, but Microsoft Connect is still only accepting "suggestions" for Dynamics CRM.

Afrikaner answered 8/5, 2012 at 19:59 Comment(1)
Very insightful answer, thank you for sharing. I was able to reproduce the display rule not working. I will change it to an enable rule as a "good enough" solution. Also, FYI, I was referred here (support.microsoft.com/oas/…) once to file CRM bugs. (see here for my original request: social.microsoft.com/Forums/eu/crmdevelopment/thread/…)Tailor
O
2

It's fixed in CRM 2013. I just tested it and work

Overlong answered 15/1, 2014 at 7:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.