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

Announcements

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard