Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRM 2011 Ribbon DisplayRule ValueRule check for null

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.

like image 850
BenPatterson1 Avatar asked May 08 '12 19:05

BenPatterson1


Video Answer


2 Answers

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.

like image 169
Peter Majeed Avatar answered Sep 24 '22 22:09

Peter Majeed


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

like image 22
Isaac Sultan Avatar answered Sep 24 '22 22:09

Isaac Sultan