应根据潜在客户状态隐藏功能区按钮 - CRM 2011

时间:2012-07-24 16:36:41

标签: dynamics-crm-2011

我在铅色带中有自定义按钮。当铅合格时,应隐藏自定义按钮。我怎样才能做到这一点?任何人都可以解释一下。我很感激。

1 个答案:

答案 0 :(得分:2)

您可以使用内置的DisplayRule功能完全实现此目的。当Lead合格时,StatusCode属性设置为"合格",转换为" 3"的OptionSet值。您可以在ValueRule中检查此属性的值,并相应地显示/隐藏控件。我可以想到两种方法来实现这个目标:

Erik Pool的视觉功能区编辑器 Lead

<强> RibbonXml

<RibbonDiffXml>
  <CustomActions>
    <CustomAction Id="CompanyName.Form.lead.MainTab.Actions.Sample.CustomAction" Location="Mscrm.Form.lead.MainTab.Actions.Controls._children" Sequence="41">
      <CommandUIDefinition>
        <Button Id="CompanyName.Form.lead.MainTab.Actions.Sample" Command="CompanyName.Form.lead.MainTab.Actions.Sample.Command" Sequence="29" ToolTipTitle="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" LabelText="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" ToolTipDescription="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.Description" TemplateAlias="isv" />
      </CommandUIDefinition>
    </CustomAction>
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command">
      <EnableRules />
      <DisplayRules>
        <DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule" />
      </DisplayRules>
      <Actions>
        <Url Address="http://www.bing.com" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules>
      <DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule">
        <ValueRule Field="statuscode" Value="3" />
      </DisplayRule>
    </DisplayRules>
    <EnableRules />
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.LabelText">
      <Titles>
        <Title languagecode="1033" description="Sample" />
      </Titles>
    </LocLabel>
    <LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.Description">
      <Titles>
        <Title languagecode="1033" description="Sample Description" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>