Customizing Command Bars is often one of the first tasks a Dynamics 365 developer needs to learn how to do. Here are a few tricks to keep in mind that will help you avoid costly mistakes in the future.
Dynamics CE works by storing a standard model of the Command Bar in memory. Any modifications made to the model are stored in an xml file called RibbonDiffXML. (Called this because older versions of Dynamics CRM used Ribbons in place of Command Bars). Thus, this file will have only the changes you made and nothing else.
Avoid Writing XML
There are tools that handle writing and editing the XML for you. One of the best is Ribbon Workbench. It is almost always a waste of time writing your own XML. While it can be helpful to understand it in case there’s a problem with it or if you run into unexpected behavior, generally the best solution is not editing the XML directly.
Avoid Referencing Unused Entities
Time is money. Time spent publishing is time that could be spent on other more useful tasks. Thus, it is important to prevent long publishing times. One common mistake new developers make when creating a new Command Bar solution is to import all available entities instead of only the ones they will be changing. This unnecessary importation can drastically increase publishing times because every additional entity referenced requires additional time to compile and build.
Command Bars Not Showing Saved Changes
When accessing Dynamics CE online, the Command Bars and Sitemap are loaded only once, then cached. Any modifications made will not be reflected by a simple refresh. To see any changes, use a full refresh (CTL+F5 or CTL+SHIFT+R depending on the browser). This will force a full page load and reload the latest state of the Command Bars and Sitemap.