|
1 | 1 | --- |
2 | | -title: Button in command bar not showing after grid item selection |
3 | | -description: Button in command bar doesn't appear after grid item selection in Microsoft Dynamics CRM Online. |
| 2 | +title: Button in Command Bar Not Showing After Grid Item Selection |
| 3 | +description: Resolving the issue where a button in the command bar doesn't appear after selecting grid items in Microsoft Dynamics 365 apps. |
4 | 4 | ms.reviewer: |
5 | | -ms.topic: troubleshooting |
6 | | -ms.date: 03/31/2021 |
| 5 | +ms.date: 04/07/2025 |
7 | 6 | ms.custom: sap:Opportunity |
8 | 7 | --- |
9 | | -# Button in command bar doesn't appear after grid item selection in Microsoft Dynamics CRM Online |
| 8 | +# Button in command bar doesn't appear after grid item selection |
10 | 9 |
|
11 | | -This article provides a resolution for the issue that the button customized to show doesn't appear as expected after one or more grid items are selected in Microsoft Dynamics CRM Online. |
| 10 | +This article provides a solution to the issue where a custom button on the command bar doesn't appear after selecting one or more grid items in Dynamics 365 apps. |
12 | 11 |
|
13 | | -_Applies to:_ Microsoft Dynamics CRM Online |
| 12 | +_Applies to:_ Microsoft Dynamics 365 |
14 | 13 | _Original KB number:_ 4481268 |
15 | 14 |
|
16 | 15 | ## Symptoms |
17 | 16 |
|
18 | | -There's a custom button that is customized to appear in the grid (either `HomePageGrid` or a `SubGrid`) in Microsoft Dynamics CRM Online. |
| 17 | +A custom button is configured to appear in the grid, either in the `HomePageGrid` or `SubGrid` in Dynamics 365 apps. |
19 | 18 |
|
20 | | -In web client, this button will appear in the ribbon/command bar, regardless if grid items are selected or not. |
21 | | - |
22 | | -In UCI, this button will appear when no grid items are selected, but once one or more grid items are selected, the button is gone. |
| 19 | +- In the web client, this button appears in the ribbon or command bar regardless of whether grid items are selected. |
| 20 | +- In the Unified Client Interface (UCI), this button appears when no grid items are selected. However, after selecting one or more grid items, the button disappears. |
23 | 21 |
|
24 | 22 | ## Cause |
25 | 23 |
|
26 | | -As part of the design for UCI, we've changed the behavior to be more context sensitive. Specifically, on grids, buttons are considered either *item specific* or not, and only *item-specific* buttons are shown when one or more items are selected, while non *item-specific* buttons are shown otherwise. |
| 24 | +This behavior is by design in the UCI. UCI introduces a context-sensitive approach to button visibility in grids. Specifically: |
27 | 25 |
|
28 | | -This means that buttons that don't require an item to be selected, will simply not be shown when an item is selected. |
| 26 | +- Buttons are categorized as either item-specific or not. |
| 27 | +- When one or more grid items are selected, only item-specific buttons are displayed. |
| 28 | +- Buttons that don't require item selection are hidden when grid items are selected. |
29 | 29 |
|
30 | | -The method that the determination is made is based on whether the command associated with the ribbon button has a SelectionCount rule. If it has a SelectionCount rule, it's considered to be an *item-specific* command. |
| 30 | +The context-sensitive behavior determines whether a button is considered item-specific based on the presence of a [selection count rule](/power-apps/developer/model-driven-apps/define-ribbon-enable-rules#selection-count-rule) in the associated command. If the command has a selection count rule, the button is categorized as item-specific. |
31 | 31 |
|
32 | 32 | > [!NOTE] |
33 | | -> Flyouts and split buttons are excluded from this change, and still shown in both cases of when items are selected or not. This is to ensure that menu items, some of which may be generated dynamically, isn't incorrectly hidden. |
| 33 | +> Flyouts and split buttons are excluded from this behavior and are displayed regardless of item selection. This ensures that dynamic menu items aren't hidden incorrectly. |
34 | 34 |
|
35 | 35 | ## Resolution |
36 | 36 |
|
37 | | -This is designed behavior that affects all buttons not just custom buttons, but out of box buttons as well (Note - flyouts and split buttons excluded since they have a menu with further child buttons and can't be easily categorized). This is an explicit design change from web client to Unified Client. |
| 37 | +This design affects all buttons, including both custom and out-of-box buttons, except for flyouts and split buttons. This change helps prioritize item-specific commands by hiding non-item-specific buttons during item selection. |
38 | 38 |
|
39 | 39 | In most cases, it's helpful to hide buttons that don't act on selected items, so that *item-specific* commands appear more prominently. |
40 | 40 |
|
41 | | -If there's a strong scenario where users will need to run a generic command, unrelated to the items selected, during item selection, then the following workaround can be used: |
42 | | - |
43 | | -In the definition of their Custom Ribbon Command, add the following rule: |
| 41 | +If you need to run a generic command unrelated to the items selected during item selection, you can add the following rule to the definition of the custom ribbon command: |
44 | 42 |
|
45 | | -```console |
| 43 | +```XML |
46 | 44 | <EnableRule Id="Mscrm.AnySelection" /> |
47 | 45 | ``` |
48 | 46 |
|
49 | | -This will cause the Unified Client to treat this command as both an *item-specific* command, and a non-item specific command, and display in both cases. |
| 47 | +This rule causes the Unified Client to treat the command as both an item-specific and a non-item-specific command, ensuring the button appears in both scenarios. |
| 48 | + |
| 49 | +## More information |
| 50 | + |
| 51 | +[Enhanced user experience with Unified Interface for model-driven apps](/power-apps/user/unified-interface) |
| 52 | + |
| 53 | +[Ribbons in model-driven apps](/power-apps/developer/model-driven-apps/ribbons-available) |
0 commit comments