So… back in old times we used to struggle with Ribbon Workbench for adding buttons in Dynamics 365 CRM. It was a nice way to do it but now we have an easier way out! Let’s welcome Power Fx Buttons!! 😀
- Add your desired entity (I will refer it as ‘Demo Entity’) in an App.
- Edit your App in Preview.
- Locate your entity (‘Demo Enity’) and click on the three dots to get the ‘Edit Command Bar (preview)’ option.
- Choose your desired selection and then click on Edit button. I am selecting Main Form.
- Click on New Command option. It will add a new button ‘NewCommand’. Rename it via the Label option in the right panel.
- You can add icon for your button from the same panel.
- Once you are done, click on Save and Publish button.
- For adding action to your button, select Run JavaScript from the Action Dropdown in the right panel.
- Define the Library and Function names , and your button is ready with the functionality.
- Here’s my nicely done button with icon on the Main Form.
- At times, I kept on getting a message Failed to delete component. Please delete the component from canvas studio. This was coming when I was changing the Action of the button. I simply reloaded the page and it was fine then. This might be a bug for the time being, as it is still in Preview mode. I hope it gets fixed before this is released officially.