web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to hide/show a ribbon button in application ribbon using either JavaScript or Ribbon Workbench?

(1) ShareShare
ReportReport
Posted on by 2
I have tried both the approaches:
Through Ribbon workbench, applied display rules as well as enable rule when status is available, button should be visible else not.
In JavaScript, on click of another button, the available button should be visible otherwise , for that I added this line:
parent.document.querySelector('[data-id=/hoabl.ApplicationRibbon.Button11.Button/]').style.display = /none/;
this works fine when testing in console but not in code. 
Any Suggestions?
I have the same question (0)
  • Amandeep Singh (Defacto Infotech Mohali) Profile Picture
    26 on at
    How to hide/show a ribbon button in application ribbon using either JavaScript or Ribbon Workbench?
    Try This.
     
    1 Create Web resource 
                       
      function HideButton(Pc){
            //alert("in");
           var mobilePhone = Pc.getAttribute("cr1d9_phone").getValue();
          if(mobilePhone!=null){
                return true;
          }else{
            return false;
          }
       }
     
    2 Create Enable Rule.
     
     
    3 Use This Rule in your Command.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 235

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 177

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 156 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans