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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 170 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 155

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans