更改“新建”按钮引用子网格

时间:2014-01-13 15:13:16

标签: dynamics-crm dynamics-crm-2013

机会表格作为报价子网格。我试图隐藏现有的“新建”按钮并创建一个自定义按钮。隐藏现有按钮就像魅力一样。但是,我没有做任何事情似乎使自定义按钮出现。

我尝试使启用和可见性条件变得简单,只需检查表单是否适用于现有实体。似乎没什么用。

这是引用的XML。使用Ribbon Workbench生成:

<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomActions>
    <CustomAction Id="ntcp.quote.Button1.Button.CustomAction" Location="Mscrm.SubGrid.quote.MainTab.Management.Controls._children" Sequence="17">
      <CommandUIDefinition>
        <Button Alt="$LocLabels:ntcp.quote.Button1.Button.Alt" Command="ntcp.quote.Command0.Command" Description="" Id="ntcp.quote.Button1.Button" Image32by32="/_imgs/ribbon/newrecord32.png" Image16by16="/_imgs/ribbon/New_16.png" LabelText="$LocLabels:ntcp.quote.Button1.Button.LabelText" Sequence="17" TemplateAlias="o1" ToolTipTitle="$LocLabels:ntcp.quote.Button1.Button.ToolTipTitle" ToolTipDescription="$LocLabels:ntcp.quote.Button1.Button.ToolTipDescription" ModernImage="New" />
      </CommandUIDefinition>
    </CustomAction>
    <HideCustomAction HideActionId="ntcp.Mscrm.SubGrid.quote.AddNewStandard.Hide" Location="Mscrm.SubGrid.quote.AddNewStandard" />
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="ntcp.quote.Command0.Command">
      <EnableRules>
        <EnableRule Id="ntcp.quote.EnableRule0.EnableRule" />
      </EnableRules>
      <DisplayRules>
        <DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule" />
      </DisplayRules>
      <Actions>
        <JavaScriptFunction FunctionName="ntcp_QuoteFromOpportunity" Library="$webresource:ntcp_/quoteFromOpportunity.js" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules>
      <DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule">
        <FormStateRule State="Existing" Default="true" />
      </DisplayRule>
    </DisplayRules>
    <EnableRules>
      <EnableRule Id="ntcp.quote.EnableRule0.EnableRule">
        <FormStateRule State="Existing" Default="true" />
      </EnableRule>
    </EnableRules>
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="ntcp.quote.Button1.Button.LabelText">
      <Titles>
        <Title description="Add New Quote" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="ntcp.quote.Button1.Button.ToolTipTitle">
      <Titles>
        <Title description="Add New Quote" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="ntcp.quote.Button1.Button.ToolTipDescription">
      <Titles>
        <Title description="Add New Quote" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="ntcp.quote.Button1.Button.Alt">
      <Titles>
        <Title description="Add New Quote" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

这是CRM2011还是CRM2013?如果是CRM2013,则无法在表单子网格上添加新按钮 - 仅在完整的相关子网格视图上。

默认情况下,按钮是可见的,因此您不需要任何特殊的显示/启用规则。

希望这有帮助, 斯科特