我当前正在尝试根据表单上复选框的值显示/隐藏自定义功能区按钮。
我已经设法让我的XML与我创建的<EnableRule>一起工作得很好,但是一旦我尝试使用<DisplayRule>,不管我在new_is_trading字段中输入什么值,有问题的按钮都会消失。
下面是我的XML:
<CommandUIDefinition>
<Group Id="Mscrm.Form.account.CustomGroup.Group"
Command="Mscrm.Form.account.CustomGroup.Command"
Title="Client Commands"
Sequence="51"
Template="Mscrm.Templates.Flexible2">
<Controls Id="Mscrm.Form.account.CustomGroup.Controls">
<Button Id="Mscrm.Form.account.CustomGroup.Button.A"
Command="Mscrm.Form.account.CustomGroup.Button.A.Command"
Sequence="10"
LabelText="Custom Button"
ToolTipTitle="Description"
ToolTipDescription="Should only be shown if this account is trading"
TemplateAlias="o1"
Image16by16="/_imgs/ribbon/CustomEntity_16.png"
Image32by32="/_imgs/ribbon/CustomEntity_32.png" />
</Controls>
</Group>
</CommandUIDefinition>然后在我的规则定义中:
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="Mscrm.Form.account.CustomDisplayRules.DisplayIfClient">
<ValueRule Field="new_is_trading" Value="true" />
</DisplayRule>
</DisplayRules>
<EnableRules>
<EnableRule Id="Mscrm.Form.account.CustomEnableRules.EnableIfClient">
<ValueRule Field="new_is_trading" Value="true" />
</EnableRule>
</EnableRules>
</RuleDefinitions>同样,我的EnableRule运行良好,但我的DisplayRule由于某种原因不能正常工作!
发布于 2012-08-25 00:09:55
使用1(true)和0(false)来比较布尔值-这是可行的。我也有同样的问题。
发布于 2012-06-22 13:36:52
我不确定enable是如何工作的,但这里有一个我正在使用的工作命令定义的示例。这没有使用value属性,但我知道下面的代码运行良好,而且似乎缺少对您创建的规则的引用……
<CommandDefinitions>
<CommandDefinition Id="Mscrm.Isv.account.grid.ShowMap.Command">
<EnableRules>
<EnableRule Id="Mscrm.Isv.account.Clients.EnableRule" />
<EnableRule Id="Mscrm.Isv.account.grid.OneSelected.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="Mscrm.Isv.account.Clients.DisplayRule" />
</DisplayRules>
<Actions>
<JavaScriptFunction Library="$webresource:way_showBingMapAll.js" FunctionName="showBingMap" />
</Actions>
</CommandDefinition>
</CommandDefinitions>https://stackoverflow.com/questions/10525316
复制相似问题