Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Hiding a Ribbon Buttons Using Ribbon Workbench to call a JavaScript action

(1) ShareShare
ReportReport
Posted on by 9
I've created a button in Ribbon workbench with a command where when i click on it runs a JS script, first i read a Yes/No value from a table and what i want to do is if this value is /No/ hide the Save and Remove buttons.

 
 
 
_onClickCheckBoolValue: function(executionContext){
        console.log(/Checking bool/);
       
        //Get the value of showdelete
        var showClassID = executionContext.getAttribute(/*****_showdelete/).getValue()
 
        if(showClassID == false){
           //Hide buttons  
        }
       
    },

I want to hide the Save (Guardar) and Delete (Eliminar) buttons on the form in the power apps,
but i cant seem to do it.

Thanks for the help.
  • Community member Profile Picture
    9 on at
    Hiding a Ribbon Buttons Using Ribbon Workbench to call a JavaScript action
    Hey,
     
     
    Yes i do know that i can add the same Display rule to each button to hide them, but what i wanted to ask is instead of going to each button manually and adding the rule, how could i modify a JS script to do it all at once from there.
     
    Is there a way to do it like that?, with a script.
     
    Thanks for the help.
  • Leah Ju Profile Picture
    Microsoft Employee on at
    Hiding a Ribbon Buttons Using Ribbon Workbench to call a JavaScript action
    Hi Partner,
    Display rules are only created once, after that you can just add them at the command of each button!
    To customise different buttons, you need to add rules to the commands corresponding to the buttons, and the same applies to the enable rules of the js code.
  • Community member Profile Picture
    9 on at
    Hiding a Ribbon Buttons Using Ribbon Workbench to call a JavaScript action
    Hi,
     
    I've used the value rule for some buttons to hide them, the problem i have with this method is that i have to modify each button one by one by adding the rule, that why i want to use a script to hide N buttons, right now i only want to hide 2 but maybe in the future i'll want to hide 5 or more, so is there any way to modify the script so i can hide all N buttons at once?
     
    Thanks for the help.
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    Hiding a Ribbon Buttons Using Ribbon Workbench to call a JavaScript action
    Hi Partner,
    If you want to hide buttons based on one field value, you can use 'Display rule-ValueRule' to achieve it easily:
    This blog provides two methods, one is 'value rule', the other is 'Javascript', you can refer to the code as well as the steps.
    More details about value rule:
     

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans