Reputation: 1
I want to hide a ribbon button in CRM 2016 using JS. I don't want to use ribbon benchwork. Any help will be appreciated.
Upvotes: 0
Views: 1581
Reputation: 18895
Not sure why you don't want to use the ribbon workbench. It's now included in the XrmToolBox as plugin, so you don't even have to install anything into CRM itself. Using the tool, you just need to locate your button, and add a custom Enable/Disable (not sure which off the top of my head) Rule that uses js. The Ribbon will load the js webresource that you've defined, and your function will just need to return a boolean.
Your other option is to hand edit the solution extract xml... yuck!
Upvotes: 0
Reputation: 769
If you don't want to use ribbon workbench you can export ribbon as zip file. Then extract it and manually edit XML file. Here you can find XML reference that will tell you what nodes, attributes and values you should change to achieve required result.
EDIT: to answer your question - there is no supported way to hide a ribbon button from javascript. You could try finding button by ID and changing display attribute but it's UNSUPPORTED.
Upvotes: 2