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.
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 aValueRule
for anEnableRule
, you'll see that the button in fact becomes enabled (or disabled depending on what you set forInvertResult
). It just doesn't work forDisplayRule
s. (My best guess is they just put more effort into developingEnableRules
instead ofDisplayRules
; as mentioned in your link, there's no support forCustomRule
s forDisplayRules
either, though it exists forEnableRules
.)I'd file a bug report, but Microsoft Connect is still only accepting "suggestions" for Dynamics CRM.
It's fixed in CRM 2013. I just tested it and work