Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
A button on the command bar is hidden when it should be visible in Power Apps
Applies to: Power Apps
Original KB number: 4552163
Determine why a button is hidden
A button can be hidden due to an enable rule or display rule on the command associated with the button evaluating to false. It could be that the associated command has a Mscrm.HideOnModern display rule that would hide the button in Unified Interface applications. A HideCustomAction could also have been created that would force the button to be hidden. If the user is offline, custom commands and default commands without the Mscrm.IsEntityAvailableForUserInMocaOffline enable rule won't be displayed.
Warning
- Any display rule of the EntityPrivilegeRule type with a PrivilegeType value of one of the following (Create, Write, Delete, Assign, Share) will evaluate to false if the entity has the Read-Only in Mobile option enabled, which will force the entity to only permit Read privilege. Examples of some of the most common default system rules that will evaluate to false when the Read-Only in Mobile flag is enabled on the entity, are as follows, but not limited only to this list (
Mscrm.CreateSelectedEntityPermission,Mscrm.CanSavePrimary,Mscrm.CanWritePrimary,Mscrm.CanWriteSelected,Mscrm.WritePrimaryEntityPermission,Mscrm.WriteSelectedEntityPermission,Mscrm.CanDeletePrimary,Mscrm.DeletePrimaryEntityPermission,Mscrm.DeleteSelectedEntityPermission,Mscrm.AssignSelectedEntityPermission,Mscrm.SharePrimaryPermission,Mscrm.ShareSelectedEntityPermission). You can edit the entity and uncheck the Read-Only in Mobile option to permit these rules to evaluate to true, provided the privilege being tested by the rule is also granted to the user. - Do not remove the
Mscrm.HideOnModerndisplay rule from a command to force a button to appear in the Unified Interface. Commands that have theMscrm.HideOnModerndisplay rule are intended for the legacy Web Client interface and are not supported in the Unified Interface, and might not work correctly.
Enable Command checker and select the command button to inspect.
The following example shows the New button on the contact entity's grid page isn't visible and is represented by an item labeled New (hidden).
Note
If your button doesn't appear in the list, it might be hidden for one of the following reasons:
HideCustomAction customization:
- In the left navigation panel, look for the
HideCustomActionsection at the top. - Expand the list and review each item. Check the location properties for a match with your button's name.
- If a match is found, this is likely why your button is hidden. To resolve the issue, follow the Repair Options instructions, but apply them to the
HideCustomActioninstead of a command.
- In the left navigation panel, look for the
Mscrm.HideOnModern display rule:
- The associated command might have a
Mscrm.HideOnModerndisplay rule, which hides the button in Unified Interface applications. - Currently, the Command Checker tool doesn't list buttons hidden by this rule. This limitation is being addressed in a future update.
- The associated command might have a
Manually hidden in the command bar designer:
- Open the command bar designer for your app.
- Locate your button and check the properties pane.
- At the bottom, verify that the Hidden field isn't checked.
Note
If the button remains hidden even when all rules evaluate to True, check the hidden reason in the navigation panel:
Hidden by selection:
- It means that the button is hidden due to context sensitive commands in grids.
- When records are selected in a grid, any button without a
SelectionCountRuleelement is considered not relevant to the selected record(s) and will be hidden, even if its rule evaluation is True. - Note that flyouts aren't affected, as flyout children might still have record-based commands.
Hidden offline:
- The command is hidden because you are offline, or the app is set to offline by default.
- This command isn't supported in offline mode. You can adjust your app's offline settings and disable offline-first if needed.
Select the Command Properties tab to display the details of the command for this button. This will show the enable rules and display rules, along with the result (True, False, Skipped) of each rule evaluation. The following example shows the New (hidden) button's command to be
Mscrm.NewRecordFromGridand there's an enable rule namednew.contact.EnableRule.EntityRulethat has evaluated to False, as a result the button will be hidden.👁 Screenshot shows the Command properties details of the command for the New (hidden) button.
Expand the
new.contact.EnableRule.EntityRuleenable rule, by selecting on the chevron 👁 Image
icon to view the details of the rule. To understand why a rule evaluates to True or False requires a little understanding of the type of rule. For details of each type of rule, see Define ribbon enable rules, and Define ribbon display rules. The following example shows that the rule type is Entity and the entity logical name is account. Since the current entity is contact, which isn't equal to account, this rule returns False.👁 Screenshot shows an example to view the details of the rule.
The approach needed to fix a button's visibility will depend on the various customizations in your specific scenario. Considering our example:
- If this rule was created erroneously, such that the entity declared in the rule was intended to be contact but was set to account, you could edit the
new.contact.EnableRule.EntityRuleenable rule and make changes that would permit the rule to evaluate to true. - If this rule was added to the command unintentionally, you could modify the
Mscrm.NewRecordFromGridcommand and remove thenew.contact.EnableRule.EntityRuleenable rule from the command definition. - If the command is an override of a Microsoft published definition, then this custom version of the command could be deleted to restore the default functionality.
- If this rule was created erroneously, such that the entity declared in the rule was intended to be contact but was set to account, you could edit the
Repair Options
Select a repair option from one of the tabs below. The first tab is selected by default.
How to delete a command
If there's another solution layer that contains a working definition of the command, then you can delete the definition to restore the inactive working definition.
If this is the only layer and you no longer need the command, then you can remove it from your solution if no other button is referencing the command.
In order to delete a command, we need to determine which solution installed the customization:
Select the View command definition solution layers link below the command name to view the solution(s) that installed a definition of the command.
👁 Screenshot of the View command definition solution layers link under a command name.
The Solution Layers pane will display the layering of each ribbon component definition a particular solution has installed. The layer at the top of the list is the current definition that is used by the application, the other layers are inactive and aren't used by the application at the moment. If the top solution is uninstalled or an updated version is installed that removes the definition, then the next layer will become the current active definition used by the application. When an unmanaged Active solution layer is present, it will always be the definition the application uses. If there's no Active solution listed, then the solution listed at the top of the list will be the definition used by the application. Any custom-managed solutions that aren't published by Microsoft will also take precedence over Microsoft published solution layers.
The Entity context indicates the object the ribbon customization is on, if "All Entities" is listed, then the layer is from the Application Ribbon client extensions and not entity specific, otherwise the logical name of the entity will be listed.
When there are two or more layers, you can select two rows and select Compare to view a comparison of the definitions brought in by each solution.
Selecting Back will return to the previous Command Checker window.
The following image shows the solution layers for the command in our example, and indicates that there's a solution layer for the contact entity that it's an unmanaged customization as denoted by the solution titled Active. Your actual scenario may differ, you may not have an Active solution layer, you may have a managed solution and the name of that solution will be listed here.
Now that we have reviewed the solution layers and identified the solution that installed the customization, we must fix the definition in the appropriate solution.
Select one of the following options that matches your particular scenario:
Feedback
Was this page helpful?
