zoukankan      html  css  js  c++  java
  • Enabling button in SubGrid on selection of record (SelectionCountRule) in CRM 2011(abstract)

    We had a requirement to have a custom button on a subgrid for an entity, and the button should only be enabled if and only if one record is selected.

    It should get disabled in case if no records are selected or more than one record selected.

    Used the below ribbondiffxml to achieve that

    <RibbonDiffXml>
            <CustomActions>
              <CustomAction Id="MyOrg.CustomAction" Location="Mscrm.SubGrid.entitySchemaName.MainTab.Management.Controls._children" Sequence="50">
                <CommandUIDefinition>
                  <Button Id="MyOrg.Button" ToolTipTitle="Upload Required Document" ToolTipDescription="Upload Required Documents for the Case" Command="MyOrg.Command" Sequence="50" LabelText="Upload Document" Alt="Upload Document To Portal" Image16by16="/_imgs/ribbon/AddEmail_16.png" Image32by32="/_imgs/ribbon/Email_32.png" TemplateAlias="o1" />
                </CommandUIDefinition>
              </CustomAction>
            </CustomActions>
            <Templates>
              <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
            </Templates>
            <CommandDefinitions>
              <CommandDefinition Id="MyOrg.Command">
                <EnableRules>
                  <EnableRule Id="MyOrg.EnableRule"></EnableRule>
                </EnableRules>
                 <DisplayRules />
                <Actions>
                  <JavaScriptFunction Library="$webresource:new_test" FunctionName="showvalue">
                    <StringParameter Value="Guid(s) Selected"></StringParameter>
                    <CrmParameter Value="SelectedControlSelectedItemIds"></CrmParameter>
                  </JavaScriptFunction>
                </Actions>
              </CommandDefinition>
            </CommandDefinitions>
            <RuleDefinitions>
              <TabDisplayRules />
              <DisplayRules />
              <EnableRules>
                <EnableRule Id="MyOrg.EnableRule">
                  <SelectionCountRule AppliesTo="SelectedEntity" Maximum="1" Minimum="1"></SelectionCountRule>
                </EnableRule>
              </EnableRules>
            </RuleDefinitions>
            <LocLabels />
          </RibbonDiffXml>
    

      

  • 相关阅读:
    Linux 动态库剖析
    【jquery mobile笔记二】jquery mobile调用豆瓣api示例
    地标性建筑
    地标性建筑
    翻译的艺术 —— 专有名词(广告词、国外品牌、语言等)
    翻译的艺术 —— 专有名词(广告词、国外品牌、语言等)
    黄金白银、古董与收藏
    黄金白银、古董与收藏
    经典书单 —— 计算机图形学
    经典书单 —— 计算机图形学
  • 原文地址:https://www.cnblogs.com/Republic/p/2153135.html
Copyright © 2011-2022 走看看