CRM 2011 Ribbon DisplayRule ValueRule check for null

半城伤御伤魂 提交于 2019-12-23 09:39:01

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/10505040/crm-2011-ribbon-displayrule-valuerule-check-for-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!