A hot area of investment from the Dataverse product team in Wave 1 2021 has been the Relevance search experience. https://docs.microsoft.com/en-us/powerapps/user/relevance-search
Part of this new search experience brings the command bar to the inline search results as well as the search results screen.
What's really cool is that you can customize these command bar buttons using the Ribbon Workbench. The relevance search can have up to 3 buttons visible when you hover over a record, and then an additional 2 actions in the overflow (maximum of 5 command buttons).
The search experience picks up commands from the HomePage Grid command bar, and this is where we can apply our customizations using the Ribbon Workbench.
Adding new buttons
To add a custom button to the Search Experience - both the drop-down and the search results grids, follow these steps:
- Create a temporary solution that contains just the entities you wish to add a command button to. Don’t include any additional components for performance reasons (see https://ribbonworkbench.uservoice.com/knowledgebase/articles/169819-speed-up-publishing-of-solutions)
- Drag a button onto the Home Command Bar and add your new command.
Note: Here I am using the Quick JS Smart Button (https://ribbonworkbench.uservoice.com/knowledgebase/articles/896958-smart-buttons) but you can add whatever you want!
- To your command, add a new Enable Rule:
UnCustomised (IsCore): True
Important: The IsCore property tells the Ribbon Workbench that this rule is an out-of-the-box rule that we don’t need to provide an implementation for in our customizations.
Note: You can also use Mscrm.ShowOnGridAndQuickAction if you want the button to appear both on the Home Page grid AND on the search results.
- At the time of writing, it seems that custom SVG icon web resources are not supported and so your button will appear with a blank icon. To get around this you can either leave the modern icon blank (your button will be assigned the default icon) or you can use a Modern icon name from one of the other out-of-the-box icons.
- Publish and wait (Yes, I’d make it quicker if I could!)
Removing existing out of the box buttons
Perhaps you don't want to show an existing out-of-the-box button on the search results, or you want to make space for your own. You can do this using another specific EnableRule Mscrm.ShowOnGrid:
- Find the button you want to remove from the quick actions (e.g. Assign Button)
- Right Click -> Customize Command
- Add the Enable Rule Mscrm.ShowOnGrid and again set ‘IsCore’ to true
The Mscrm.ShowOnGrid enable rule tells the command bar to only show the command on the home page and not the search results.
- Set IsCore to true for all the other out of the button Enable & Display Rules that were added when you customized the command (e.g. Mscrm.AssignSelectedRecord).
Once you've added the new button, and hidden the existing one, you'll see the changes to the command bar after doing a hard refresh on your App in the browser:
Pretty cool! For more info about the Enable Rules used by Relevance Search, see https://docs.microsoft.com/en-us/power-platform/admin/configure-relevance-search-organization#configure-quick-actions
Hope this helps!