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

Notifications

Announcements

No record found.

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
    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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans