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,...
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.
I have the same question (0)
  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    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:
     
  • Community member Profile Picture
    9 on at
    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.
  • Leah Ju Profile Picture
    Microsoft Employee on at
    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
    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.

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 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans