javascript - 客户关系管理 2015 : Custom Ribbon buttons in quote entity not visible after the quote is activated

标签 javascript dynamics-crm dynamics-crm-2015 crm-ribbon-workbench

我在功能区上为报价实体表单添加了一个自定义按钮。 当报价处于草稿状态时,该按钮可见并且按预期工作。

当我单击“激活报价”按钮时,报价将变为事件状态。此操作还会刷新功能区。刷新功能区后,我不再看到我在功能区中添加的自定义按钮。

我 checkin 了功能区工作台,并且我添加的自定义按钮没有定义任何显示规则,这可能会导致它在激活报价上隐藏。
我还检查了任何可能导致此行为的自定义脚本,但我找不到任何会使自定义按钮不可见的脚本。

我尝试将自定义按钮添加到功能区中的不同组,但这似乎也没有帮助。

一旦报价被激活,功能区似乎只在报价实体表单上显示一组预定义的控件。 有人对我如何规避这个问题有任何建议吗?

下面是报价实体的ribbondiffxml。我添加的自定义按钮是“复制估计”和“新版本”

<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomActions>
    <CustomAction Id="Sol.Form.Estimate.CopyEntity.Button.CustomAction" Location="Mscrm.Form.quote.MainTab.Actions.Controls._children" Sequence="4">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:Sol.Form.Estimate.CopyEntity.Button.Alt" Command="Sol.Form.Estimate.CopyEntity.Command" Description="Copy Estimate" Id="Sol.Form.Estimate.CopyEntity.Button" Image32by32="$webresource:mcace_EntityRibbon_32x32.png" Image16by16="$webresource:mcace_EntityRibbon_16x16.png" LabelText="$LocLabels:Sol.Form.Estimate.CopyEntity.Button.LabelText" Sequence="4" TemplateAlias="o1" ToolTipTitle="$LocLabels:Sol.Form.Estimate.CopyEntity.Button.ToolTipTitle" ToolTipDescription="$LocLabels:Sol.Form.Estimate.CopyEntity.Button.ToolTipDescription" />
      </CommandUIDefinition>
    </CustomAction>
    <CustomAction Id="Sol.Form.Estimate.NewVersion.Button.CustomAction" Location="Mscrm.Form.quote.MainTab.Actions.Controls._children" Sequence="4">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:Sol.Form.Estimate.NewVersion.Button.Alt" Command="Sol.quote.Estimate.NewVersion.Command" Description="New Version" Id="Sol.Form.Estimate.NewVersion.Button" Image32by32="/_imgs/SFA/ReviseQuote_32.png" Image16by16="/_imgs/SFA/ReviseQuote_16.png" LabelText="$LocLabels:Sol.Form.Estimate.NewVersion.Button.LabelText" Sequence="4" TemplateAlias="o1" ToolTipTitle="$LocLabels:Sol.Form.Estimate.NewVersion.Button.ToolTipTitle" ToolTipDescription="$LocLabels:Sol.Form.Estimate.NewVersion.Button.ToolTipDescription" />
      </CommandUIDefinition>
    </CustomAction>
    <HideCustomAction HideActionId="Sol.Mscrm.Form.quote.ReviseQuote.Hide" Location="Mscrm.Form.quote.ReviseQuote" />
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="Sol.Form.Estimate.CopyEntity.Command">
      <EnableRules>
        <EnableRule Id="Sol.Form.Estimate.CopyEntity.EnableRule" />
      </EnableRules>
      <DisplayRules />
      <Actions>
        <JavaScriptFunction FunctionName="triggerCopyEntity" Library="$webresource:sol_Entity_Ribbon.js" />
      </Actions>
    </CommandDefinition>
    <CommandDefinition Id="Sol.quote.Estimate.NewVersion.Command">
      <EnableRules>
        <EnableRule Id="Sol.Form.Estimate.CopyEntity.EnableRule" />
      </EnableRules>
      <DisplayRules />
      <Actions>
        <JavaScriptFunction FunctionName="setIsNewVersionField" Library="$webresource:sol_Estimate_ribbon" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules>
      <DisplayRule Id="Sol.Form.Estimate.DisplayRule.DisplayRule">
        <CrmClientTypeRule Type="Web" Default="true" />
      </DisplayRule>
    </DisplayRules>
    <EnableRules>
      <EnableRule Id="Sol.Form.Estimate.CopyEntity.EnableRule">
        <FormStateRule State="Existing" Default="false" InvertResult="false" />
      </EnableRule>
    </EnableRules>
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="Sol.Form.Estimate.CopyEntity.Button.LabelText">
      <Titles>
        <Title description="Copy Estimate" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.CopyEntity.Button.ToolTipTitle">
      <Titles>
        <Title description="Copy Estimate" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.CopyEntity.Button.ToolTipDescription">
      <Titles>
        <Title description="Copy Estimate" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.CopyEntity.Button.Alt">
      <Titles>
        <Title description="Copy Estimate" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.NewVersion.Button.LabelText">
      <Titles>
        <Title description="New Version" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.NewVersion.Button.ToolTipTitle">
      <Titles>
        <Title description="New Version" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.NewVersion.Button.ToolTipDescription">
      <Titles>
        <Title description="New Version" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="Sol.Form.Estimate.NewVersion.Button.Alt">
      <Titles>
        <Title description="New Version" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>

最佳答案

尝试修改您的 EnableRule Sol.Form.Estimate.CopyEntity.EnableRule 以取消创建状态。

您修改后的规则应如下所示:

<EnableRules>
  <EnableRule Id="Sol.Form.Estimate.CopyEntity.EnableRule">
    <FormStateRule State="Create" InvertResult="true" />
  </EnableRule>
</EnableRules>

所以不要制定公式

bool enable = FormState == Existing

MS CRM 预计

bool enable = !(FormState == Create)

MS 的 Enable- 和 DisplayRules 概念对我来说也不止一次很奇怪。

关于javascript - 客户关系管理 2015 : Custom Ribbon buttons in quote entity not visible after the quote is activated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34996091/

相关文章:

javascript - 将 JSON 对象映射到单独的 div 中

javascript - 计算最大值并将背景设置为相等的父级

dynamics-crm - 与客户关联的 CRM 2016 版本标记已过期

dynamics-crm - 在预操作中更新目标是否会导致其他插件触发?

dynamics-crm-2011 - "Post"、 "PostFollow"和 "PostComment"有什么区别?

javascript - 如何在React组件中使用渲染的json数据

javascript - 从数组中获取最新值

dynamics-crm - 有没有办法更新CRM中字段的修改、创建和创建?

javascript - 从插件向用户显示警告(不是错误)消息

javascript - 在服务器端更新字段后防止触发 OnChange 函数