Asked by:
Subgrid Ribbon Display Rule Issue

Question
-
Hello everyone!
I have a pretty strange issue, I'm not sure weather it's a bug or I'm just doing something horribly wrong.
I've created a custom Assign and Resolve button for the Case entity. They work perfectly on the entity's ribbon and on it's information form ribbon. In addition to those two locations, I also desired to place the Assign button on any Case subgrids which are used elsewhere in forms. I did so by including the button in the RibbonDiffXML tag, hiding the original button and specifying the new button's location as "Mscrm.SubGrid.incident.MainTab.Collaborate.Controls._children".
The button appeared in the right place and is still functional, however you must first manually select a view for the subgrid (even if it's the default). Without selecting a view, the custom button will not obey its display rules which frequently results in it being disabled. However, once a view has been selected the display rules function as intended.
Has anyone else run into this issue? Do you know a way around it? Thanks in advance for any replies!
Kirk Roerig
Monday, June 11, 2012 12:36 PM
All replies
-
HI Kirk,
I've not seen this before - Could you post your ribbon xml so we can take a look?
Scott
Scott Durow
Read my blog: www.develop1.net/public
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"Monday, June 11, 2012 1:55 PMAnswerer -
Hello Scott,
Thank you for the reply!
Here's my XML, I tried to clean it up and comment it for readability's sake. Fyi, I had dummy <Menu> tags and their contents within the <FlyoutAnchor> tags, but I removed them since they were for test purposes only. The menus will be generated Dynamically through the Populate command.
<RibbonDiffXml> <CustomActions> <HideCustomAction Location="Mscrm.HomepageGrid.incident.DeleteMenu" HideActionId="Mscrm.HomepageGrid.incident.DeleteMenu.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddConnection" HideActionId="Mscrm.HomepageGrid.incident.AddConnection.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddToQueue" HideActionId="Mscrm.HomepageGrid.incident.AddToQueue.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Copy" HideActionId="Mscrm.HomepageGrid.incident.Copy.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddServiceActivity" HideActionId="Mscrm.HomepageGrid.incident.AddServiceActivity.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Related.Marketing" HideActionId="Mscrm.HomepageGrid.incident.Related.Marketing.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddConnection" HideActionId="Mscrm.Form.incident.AddConnection.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddToQueue" HideActionId="Mscrm.Form.incident.AddToQueue.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.CopySelected" HideActionId="Mscrm.Form.incident.CopySelected.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.SendSelected" HideActionId="Mscrm.Form.incident.SendSelected.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.Permissions" HideActionId="Mscrm.Form.incident.Permissions.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.Related.Marketing" HideActionId="Mscrm.Form.incident.Related.Marketing.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddServiceActivity" HideActionId="Mscrm.Form.incident.AddServiceActivity.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddEmail" HideActionId="Mscrm.Form.incident.AddEmail.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Developer" HideActionId="Mscrm.HomepageGrid.incident.Developer.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.Developer" HideActionId="Mscrm.Form.incident.Developer.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Sharing" HideActionId="Mscrm.HomepageGrid.incident.Sharing.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Send" HideActionId="Mscrm.HomepageGrid.incident.Send.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.AddEmail" HideActionId="Mscrm.SubGrid.incident.AddEmail.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.MailMerge" HideActionId="Mscrm.SubGrid.incident.MailMerge.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.AddConnection" HideActionId="Mscrm.SubGrid.incident.AddConnection.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.AddToQueue" HideActionId="Mscrm.SubGrid.incident.AddToQueue.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.Sharing" HideActionId="Mscrm.SubGrid.incident.Sharing.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.CopySelected" HideActionId="Mscrm.SubGrid.incident.CopySelected.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.SendSelected" HideActionId="Mscrm.SubGrid.incident.SendSelected.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.NewRecord" HideActionId="Mscrm.HomepageGrid.incident.NewRecord.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.SendDirectEmail" HideActionId="Mscrm.HomepageGrid.incident.SendDirectEmail.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddAppointment" HideActionId="Mscrm.Form.incident.AddAppointment.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddRecurringAppointment" HideActionId="Mscrm.Form.incident.AddRecurringAppointment.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddAppointment" HideActionId="Mscrm.HomepageGrid.incident.AddAppointment.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddRecurringAppointment" HideActionId="Mscrm.HomepageGrid.incident.AddRecurringAppointment.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.AddOtherActivities" HideActionId="Mscrm.Form.incident.AddOtherActivities.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddOtherActivities" HideActionId="Mscrm.HomepageGrid.incident.AddOtherActivities.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.AddEmail" HideActionId="Mscrm.HomepageGrid.incident.AddEmail.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.MainTab.Workflow" HideActionId="Mscrm.HomepageGrid.incident.MainTab.Workflow.HideAction" /> <HideCustomAction Location="Mscrm.Form.incident.MainTab.Workflow" HideActionId="Mscrm.Form.incident.MainTab.Workflow.HideAction" /> <HideCustomAction Location="Mscrm.SubGrid.incident.Assign" HideActionId="Mscrm.SubGrid.incident.Assign.HideAction" /> <HideCustomAction Location="Mscrm.HomepageGrid.incident.Assign" HideActionId="Mscrm.HomepageGrid.incident.Assign.HideAction"/> <!-- Kirk's resolve case button --> <CustomAction Id ="Mscrm.HomepageGrid.incident.Resolve" Location="Mscrm.HomepageGrid.incident.MainTab.Actions.Controls._children" Sequence="99"> <CommandUIDefinition> <FlyoutAnchor Id="Mscrm.HomepageGrid.incident.Resolve" Command="Cmd_ResolveCaseFO" Sequence="10" Image16by16="/_imgs/Ribbon/ResolveCase16.png" Image32by32="/_imgs/Ribbon/ResolveCase32.png" LabelText="$LocLabels:Sample.incident.CaseResolveButton.LabelText" Alt="Sample Flyout" TemplateAlias="isv"/> </CommandUIDefinition> </CustomAction> <!-- End Kirk's resolve case button --> <!-- Kirk's assign team button --> <CustomAction Id="amw_GridCaseAssignTeam" Location="Mscrm.HomepageGrid.incident.MainTab.Collaborate.Controls._children" Sequence="0"> <CommandUIDefinition> <FlyoutAnchor Id="amw_flyoutMenuAssignCaseTeam" Sequence="10" Command="Cmd_AssignCaseTeamFO" Image16by16="/_imgs/ribbon/Assign16.png" Image32by32="/_imgs/ribbon/Assign32.png" LabelText="$LocLabels:Sample.incident.CaseAssignButton.LabelText" ToolTipTitle="$LocLabels:Sample.incident.CaseAssignButton.ToolTipTitle" ToolTipDescription="$LocLabels:Sample.incident.CaseAssignButton.ToolTipDescription" Alt="Assign Case" TemplateAlias="o1"/> </CommandUIDefinition> </CustomAction> <!-- End Kirk's assign team button --> <!-- Kirk's assign team subgrid button --> <CustomAction Id="Mscrm.SubGrid.incident.Assign" Location="Mscrm.SubGrid.incident.MainTab.Collaborate.Controls._children" Sequence="0"> <CommandUIDefinition> <FlyoutAnchor Id="amw_flyoutMenuAssignCaseTeam" Sequence="10" Command="Cmd_AssignCaseTeamFO" Image16by16="/_imgs/ribbon/Assign16.png" Image32by32="/_imgs/ribbon/Assign32.png" LabelText="$LocLabels:Sample.incident.CaseAssignButton.LabelText" ToolTipTitle="$LocLabels:Sample.incident.CaseAssignButton.ToolTipTitle" ToolTipDescription="$LocLabels:Sample.incident.CaseAssignButton.ToolTipDescription" Alt="Assign Case" TemplateAlias="o3"/> </CommandUIDefinition> </CustomAction> <!-- End Kirk's assign team subgrid button --> </CustomActions> <Templates> <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates> </Templates> <CommandDefinitions> <!-- ResovleCaseFO: Handles the display rules for the "Resolve case" flyout anchor --> <CommandDefinition Id="Cmd_ResolveCaseFO"> <EnableRules> <EnableRule Id="Mscrm.SelectionCountExactlyOne" /> <EnableRule Id="Mscrm.VisualizationPaneNotMaximized" /> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules> <DisplayRule Id="Mscrm.AssignSelectedEntityPermission" /> </DisplayRules> <Actions/> </CommandDefinition> <!-- ResolveCase: Command that is implemented by buttons contained in the "Resolve case" flyout anchor. This command is responsible for actually invoking the code that performs the resolution of the case. --> <CommandDefinition Id="Cmd_ResolveCase"> <EnableRules> <EnableRule Id="Mscrm.SelectionCountExactlyOne" /> <EnableRule Id="Mscrm.VisualizationPaneNotMaximized" /> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules> <DisplayRule Id="Mscrm.AssignSelectedEntityPermission" /> </DisplayRules> <Actions> <JavaScriptFunction Library="$webresource:amw_CORE" FunctionName="isNaN"/> <JavaScriptFunction FunctionName="AMW.LA_1_4.ResolveCase" Library="$webresource:amw_LA_1_4"> <CrmParameter Value="CommandProperties" /> <CrmParameter Value="FirstSelectedItemId" /> </JavaScriptFunction> </Actions> </CommandDefinition> <!-- QkAssTeamPopulate: Temporary command for the "Assign Case" flyout anchor a function that which will invoke in turn requests an XML structure of a menu containing teams which have been deemed assignable. This XML is then inserted into the flyout anchor. --> <CommandDefinition Id="Cmd_QkAssTeamPopulate"> <EnableRules> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules/> <Actions> <JavaScriptFunction Library="$webresource:amw_CORE" FunctionName="isNaN"/> <JavaScriptFunction FunctionName="AMW.LA_1_4.PopulateAssignFlyout" Library="$webresource:amw_LA_1_4"> <CrmParameter Value="CommandProperties" /> </JavaScriptFunction> </Actions> </CommandDefinition> <!-- AssignCaseTeamFO: Handles the display rules for the "Assign Case" flyout anchor --> <CommandDefinition Id="Cmd_AssignCaseTeamFO"> <EnableRules> <EnableRule Id="Mscrm.SelectionCountExactlyOne" /> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules> <DisplayRule Id="Mscrm.AssignSelectedEntityPermission" /> </DisplayRules> <Actions/> </CommandDefinition> <!-- QkAssTeam: Command implemented by buttons contained in the "Assign Case" flyout anchor. This command is responsible for actually invoking code that performs the assignment of the case to the team whose button invoked this command. --> <CommandDefinition Id="Cmd_QkAssTeam"> <EnableRules> <EnableRule Id="Mscrm.Enabled" /> </EnableRules> <DisplayRules/> <Actions> <JavaScriptFunction Library="$webresource:amw_CORE" FunctionName="isNaN"/> <JavaScriptFunction FunctionName="AMW.LA_1_4.QuickAssignTeam" Library="$webresource:amw_LA_1_4"> <CrmParameter Value="CommandProperties" /> <CrmParameter Value="FirstSelectedItemId" /> </JavaScriptFunction> </Actions> </CommandDefinition> </CommandDefinitions> <RuleDefinitions> <TabDisplayRules /> <DisplayRules /> <EnableRules /> </RuleDefinitions> <LocLabels> <LocLabel Id="Sample.incident.CaseAssignButton.LabelText"> <Titles> <Title languagecode="1033" description="Assign Case" /> <Title languagecode="3082" description="Assign Case ESPANOL" /> <Title languagecode="1046" description="Assign Case PORTUGUESE" /> </Titles> </LocLabel> <LocLabel Id="Sample.incident.CaseAssignButton.ToolTipTitle"> <Titles> <Title languagecode="1033" description="Assign Case (Description)" /> <Title languagecode="3082" description="Assign Case ESPANOL Description" /> <Title languagecode="1046" description="Assign Case PORTUGUESE Description" /> </Titles> </LocLabel> <LocLabel Id="Sample.incident.CaseAssignButton.ToolTipDescription"> <Titles> <Title languagecode="1033" description="Assign the case to a Team only using a drop-down menu." /> <Title languagecode="3082" description="This is the description in ESPANOL." /> <Title languagecode="1046" description="This is the description in PORTUGUESE." /> </Titles> </LocLabel> <LocLabel Id="Sample.incident.CaseResolveButton.LabelText"> <Titles> <Title languagecode="1033" description="Resolve Case" /> <Title languagecode="3082" description="Resolve Case ESPANOL" /> <Title languagecode="1046" description="Resolve Case PORTUGUESE" /> </Titles> </LocLabel> <LocLabel Id="Sample.incident.CaseResolveButton.ToolTipTitle"> <Titles> <Title languagecode="1033" description="Resolve Case (Description)" /> <Title languagecode="3082" description="Resolve Case ESPANOL Description" /> <Title languagecode="1046" description="Resolve Case PORTUGUESE Description" /> </Titles> </LocLabel> <LocLabel Id="Sample.incident.CaseResolveButton.ToolTipDescription"> <Titles> <Title languagecode="1033" description="Resolve the case without having to type a resolution using a drop-down menu." /> <Title languagecode="3082" description="This is the description in ESPANOL." /> <Title languagecode="1046" description="This is the description in PORTUGUESE." /> </Titles> </LocLabel> </LocLabels> </RibbonDiffXml>
Kirk Roerig
Monday, June 11, 2012 2:56 PM -
Hi Kirk,
Which of the enable rules are not working correctly on which command?
Scott
Scott Durow
Read my blog: www.develop1.net/public
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"Monday, June 11, 2012 4:52 PMAnswerer -
Hey Scott,
I'm sorry, I should have been more specific. It is the following command.
<!-- ResovleCaseFO: Handles the display rules for the "Resolve case" flyout anchor --> <CommandDefinition Id="Cmd_ResolveCaseFO"> <EnableRules> <EnableRule Id="Mscrm.SelectionCountExactlyOne" /> <EnableRule Id="Mscrm.VisualizationPaneNotMaximized" /> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules> <DisplayRule Id="Mscrm.AssignSelectedEntityPermission" /> </DisplayRules> <Actions/> </CommandDefinition>
Now that works fine for FlyoutAnchors that are located specifically on a form, or the entity ribbon. However, the error I described earlier occurs for the following FlyoutAnchor which resides on a subgrid.
<!-- Kirk's assign team subgrid button --> <CustomAction Id="Mscrm.SubGrid.incident.Assign" Location="Mscrm.SubGrid.incident.MainTab.Collaborate.Controls._children" Sequence="0"> <CommandUIDefinition> <FlyoutAnchor Id="amw_flyoutMenuAssignCaseTeam" Sequence="10" Command="Cmd_AssignCaseTeamFO" Image16by16="/_imgs/ribbon/Assign16.png" Image32by32="/_imgs/ribbon/Assign32.png" LabelText="$LocLabels:Sample.incident.CaseAssignButton.LabelText" ToolTipTitle="$LocLabels:Sample.incident.CaseAssignButton.ToolTipTitle" ToolTipDescription="$LocLabels:Sample.incident.CaseAssignButton.ToolTipDescription" Alt="Assign Case" TemplateAlias="o3"/> </CommandUIDefinition> </CustomAction> <!-- End Kirk's assign team subgrid button -->
Kirk Roerig
Monday, June 11, 2012 5:48 PM -
Hi Kirk,
I used the Ribbon Workbench for CRM2011 to add a flyout menu to the Incident Sub-Grid with the same enable and display rules as you have and all seems to be OK on UR8.
Because you have the 'SelectionCountExactlyOne enable rule - are you sure it isn't just because some of the views have no records returned in them, hence the button will be disabled?
I also notice that your CustomAction ID is not a unique name - it should always be prefixed with your solution namespace to ensure that there are no clashes.
Here is my FlyoutAnchorl:
<CustomAction Id="new.incident.Button2.Button.CustomAction"
Location="Mscrm.SubGrid.incident.MainTab.Collaborate.Controls._children"
Sequence="25"> <CommandUIDefinition> <FlyoutAnchor
Command="new.incident.Assign.Command"
Id="new.incident.Button2.Button"
Image16by16="$webresource:new_Image16.png"
Image32by32="$webresource:new_Image32.png"
LabelText="$LocLabels:new.incident.Button2.Button.LabelText"
Sequence="25"
TemplateAlias="o3"> <Menu Id="new.incident.Button2.Button.Menu"> <MenuSection Id="new.incident.Section3.Section" Sequence="10" DisplayMode="Menu16"> <Controls Id="new.incident.Section3.Section.Controls"> <Button
Command="new.incident.Assign.Command"
Id="new.incident.Button4.Button"
Image16by16="$webresource:new_Image16.png"
LabelText="$LocLabels:new.incident.Button4.Button.LabelText"
Sequence="20" /> </Controls> </MenuSection> </Menu> </FlyoutAnchor> </CommandUIDefinition> </CustomAction>And the Command:
<CommandDefinition Id="new.incident.Assign.Command"> <EnableRules> <EnableRule Id="Mscrm.SelectionCountExactlyOne" /> <EnableRule Id="Mscrm.VisualizationPaneNotMaximized" /> <EnableRule Id="Mscrm.NotOffline" /> </EnableRules> <DisplayRules> <DisplayRule Id="Mscrm.AssignSelectedEntityPermission" /> </DisplayRules> <Actions> <Url Address="about:blank" WinMode="0" /> </Actions> </CommandDefinition>
You might like to try stripping out all your other ribbon xml and just leave that one to see if there is some interactions going on.
You could also try with my Xml to see if that works for you.
Scott
Scott Durow
Read my blog: www.develop1.net/public
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Edited by Scott Durow (MVP)MVP, Editor Tuesday, June 12, 2012 6:39 AM
- Proposed as answer by Scott Durow (MVP)MVP, Editor Wednesday, June 13, 2012 10:08 PM
Tuesday, June 12, 2012 6:38 AMAnswerer -
Hey Scott,
I changed the Id of my FlyoutAnchor to a unique name, that unfortunately did not solve the problem. I also stripped out all my Ribbon XML and replaced it with yours and had the same issue. I should have mentioned earlier that we are on UR3, so I'm thinking this was likely a bug that has been fixed in some more recent update roll-up.
Well thanks for helping me get this figured out Scott. I appreciate it!
Kirk Roerig
- Proposed as answer by Scott Durow (MVP)MVP, Editor Wednesday, June 13, 2012 10:08 PM
Tuesday, June 12, 2012 12:44 PM