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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model-driven app - hid...
Power Apps
Unanswered

Model-driven app - hide command button with Javascript

(1) ShareShare
ReportReport
Posted on by 68

I need to know how to hide a command button using javascript.  Once the button has been clicked the button should be hidden.

 

Here's the code of the javascript function that is executed when the command button is clicked.  Once this code has been executed I want to hide the command button.

How do I do this?

 

 

// Function to Toggle Subgrid Visibility (Manual Button)
function toggleSubgridVisibility(primaryControl) {
 var formContext = primaryControl;
 var subgridControl = formContext.getControl("EventSubTypes");

 var accountablebusinessunit = formContext.getControl("bipr_accountablebusinessunit");
 var manualacimplementationstatus = formContext.getControl("bipr_manualacimplementationstatus");
 var structuredreviewimplementationstatus = formContext.getControl("bipr_structuredreviewimplementationstatus");
 var onestopimplementationstatus = formContext.getControl("bipr_onestopimplementationstatus")
 var rvpimplementationstatus = formContext.getControl("bipr_rvpimplementationstatus");
 var daterangeofaverages = formContext.getControl("bipr_daterangeofaverages");
 var averageannualvolume = formContext.getControl("bipr_averageannualvolume");
 var averageprocessduration = formContext.getControl("bipr_averageprocessduration");
 var processdurationtarget = formContext.getControl("bipr_processdurationtarget");

 // var currentVisibility = subgridControl.getVisible();

 manualToggle = true;
 // subgridControl.setVisible(!currentVisibility);
 subgridControl.setVisible(true);

 accountablebusinessunit.setVisible(false);
 manualacimplementationstatus.setVisible(false);
 structuredreviewimplementationstatus.setVisible(false);
 onestopimplementationstatus.setVisible(false)
 rvpimplementationstatus.setVisible(false);
 daterangeofaverages.setVisible(false);
 averageannualvolume.setVisible(false);
 averageprocessduration.setVisible(false);
 processdurationtarget.setVisible(false);
}

 

 

Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard