How to Show and Hide Buttons in Dynamics 365 Using Power FX in Power Apps
If you want to display different command bar buttons on a form depending on specific criteria, you can use the Power Fx button Visibility section to show or hide a button using the Formula bar.
In my real-life example, I wanted to replace the out-of-the-box Create Order button with a warning when shipping information was required.
- In Dynamics 365, browse to https://make.powerapps.com
- Click Solutions on the left side menu
- Create a new solution and add the App you want to customize (for example: Sales Hub)
- Click the App Display Name to open the App Page.
- On the left side pages, find the table you want to update (in my example I am scrolling to Quotes)
- Click the “…” to the right of the view and click the Edit command bar
- Choose the Command Bar you want to edit (in my example I am updating the Main Form)
- Click Edit
- Add a new button that you want to display in place of the out-of-the-box button
- Click the out of the box button from the view of buttons (NOTE: You might have to recreate the out-of-the-box button and hide the original button from Ribbon Workbench if you don’t see the button in the view)
- On the right-side panel, in the section called Visibility, change to Show on condition from formula.
- Click Open formula bar
- In the top fx box type the following command:
- Click the other button and follow the same steps to Show the button on condition from the formula and set the logic to the opposite of the other button.
Want to Learn More Ways to Optimize Your Software Solutions?
Reach out to Stoneridge Software! Our experts can help you refine your solutions so they work optimally for your business.
Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.
Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.