【问题标题】:Ribbon button should be hidden based on lead status - CRM 2011功能区按钮应根据潜在客户状态隐藏 - CRM 2011
【发布时间】:2012-07-25 23:28:33
【问题描述】:

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

【问题讨论】:

标签: dynamics-crm-2011


【解决方案1】:

您实际上可以完全使用内置的DisplayRule 功能完成此操作。当Lead 合格时,StatusCode 属性设置为“合格”,这将转换为OptionSet 值“3”。您可以在ValueRule 中检查此属性的值并适当地显示/隐藏控件。我可以想到两种方法来实现这一点:

Erik Pool 的可视化功能区编辑器

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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-29
    相关资源
    最近更新 更多