简体   繁体   中英

How do I hide a ribbon button in CRM 2016 using Javascript

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.

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM