Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Problem disabling Add New and Add Existing Buttons on SubGrid

$
0
0

I have two entities: new_s_cashmanagement and new_s_licenseinformation

The entity new_s_cashmanagement contains transaction records, and each transaction record is linked via a referential relationship, to all the records on new_s_licenseinformation that contain the particular transaction id I have open from new_s_cashmanagement.

All the associated new_s_licenseinformation records display on a form via a subgrid for each transaction record that's related to the transaction on  the corresponding new_s_cashmanagement record.

I need to gray out or disable the "Add New" and "Add Existing" buttons on the subgrid that shows the related new_s_licenseinformation records for the corresponding transaction I have open in new_s_cashmanagement

 



I tried to implement the ribbon customization process outlined here https://community.dynamics.com/crm/b/mscrmshop/archive/2011/11/02/enable-disable-out-of-box-buttons-sub-grid-based-on-a-custom-rule-in-crm-2011 but ran into the error shown below.

As a double check, just to make sure something didn't get messed up with the zip process, I took all three files [Content_Types].xml, customizations.xml (which is the only file I edited), and solution.xml and zipped them up into a new zip file at the root of the zip file's folder hierarchy only to find a different error that now appears on the re-import process.

The entire edited portion of <RibbonDiff> is shown below.

<RibbonDiffXml>
        <CustomActions>
          <CustomAction Id="AddExistingCustomAction"  Location="Mscrm.SubGrid.new_s_licenseinformation.AddExistingStandard"  Sequence="30">
            <CommandUIDefinition>
            <Button Id="Mscrm.SubGrid.new_s_licenseinformation.AddExistingStandard" Command="Mscrm.AddExistingRecordFromSubGridStandard" Sequence="30" LabelText="$Resources(EntityDisplayName):Ribbon.SubGrid.AddExisting" Alt="$Resources(EntityDisplayName):Ribbon.SubGrid.AddExisting" Image16by16="/_imgs/ribbon/AddExistingStandard_16.png" Image32by32="/_imgs/ribbon/AddExistingStandard_32.png" TemplateAlias="o1" ToolTipTitle="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddExistingStandard_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddExistingStandard_ToolTipDescription" />
          </CommandUIDefinition>
        </CustomAction>
          <CustomAction Id="AddExistingCustomAction2"  Location="Mscrm.SubGrid.new_s_licenseinformation.AddExistingAssoc"  Sequence="40">
            <CommandUIDefinition>
            <Button Id="Mscrm.SubGrid.new_s_licenseinformation.AddExistingAssoc" Command="Mscrm.AddExistingRecordFromSubGridAssociated" Sequence="40" LabelText="$Resources(EntityDisplayName):Ribbon.SubGrid.AddExisting" Alt="$Resources(EntityDisplayName):Ribbon.SubGrid.AddExisting" Image16by16="/_imgs/ribbon/AddExistingStandard_16.png" Image32by32="/_imgs/ribbon/AddExistingStandard_32.png" TemplateAlias="o1" ToolTipTitle="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddExistingAssoc_ToolTipTitle" ToolTipDescription="$Resources(EntityDisplayName):Mscrm_SubGrid_EntityLogicalName_MainTab_Management_AddExistingAssoc_ToolTipDescription" />
            </CommandUIDefinition>
              </CustomAction>
          </CustomActions>
      <Templates>
          <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
        </Templates>
        <CommandDefinitions>
          <CommandDefinition Id="Mscrm.AddExistingRecordFromSubGridStandard">
          <EnableRules>
            <EnableRule Id="Mscrm.AddExistingCustomRule" />
          </EnableRules>
          </CommandDefinition>
          <CommandDefinition Id="Mscrm.AddExistingRecordFromSubGridAssociated">
            <EnableRules>
              <EnableRule Id="Mscrm.AddExistingCustomRule" />
            </EnableRules>
          </CommandDefinition>
        </CommandDefinitions>
        <RuleDefinitions>
          <TabDisplayRules />
          <DisplayRules />
          <EnableRules>
            <EnableRule Id="Mscrm.AddExistingCustomRule">
              <CustomRule FunctionName="HideExisting" Library="$webresource:new_GamingLicenseApplicationFunctions" Default="false" >
                <CrmParameter Value="PrimaryEntityTypeCode" />
              </CustomRule>
            </EnableRule>
          </EnableRules>
        </RuleDefinitions>
        <LocLabels />
      </RibbonDiffXml>

I am hoping someone looking at this knows exactly what I did incorrectly, or what I didn't quite implement properly when editing this file that would  cause the "invalid solution file" error to occur on re-import.

Any help or guidance would be greatly appreciated. 


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>