Announcements
I'm creating a Model Driven App and I want to show a custom button created on the main grid when I'm in a specific entity's view. For example: If I'm on "View A" the button shows and if I'm on "View B" the button is hidden.Is this possible?
Any help is appreciated
Hi @AntonioMF ,
Below are the links that might be going to help you:
If I answer your question then please mark it as verified.
Let me know if I can provide you with more details.
ThanksRegards,
Abdul WahabPower Platform & Customer Engagement Developer/Lead/Solution Architecture/Project ManagerDirect/WhatsApp:+923323281237E-mail: abdulwahabubit@outlook.comSkype: abdul.wahabubitLinkedin: https://www.linkedin.com/in/abdul-wahab-a5b8b011a/Youtube Channel: https://www.youtube.com/channel/UCBjgLqLK_2kU-3bwo4McrTw
You could try to use a custom javascript enable rule. You can pass the executionContext (in main grid it should be SelectedControl) to method and call the function
To pass in the execution context (form context or grid context) information to JavaScript function for your ribbon actions, specify PrimaryControl for the form context, or SelectedControl for the grid context as the <CrmParameter> value in your ribbon definition. SelectedControl will pass in the grid context, for both subgrids and homepage grids. The passed in PrimaryControl or the SelectedControl value is used as an argument in your JavaScript function for form context or grid context respectively.
Then try this code:
doSomething(SelectedControl ) { var gridContext = SelectedControl var viewSelector = gridContext.getViewSelector(); var gridId = viewSelector.getCurrentView()[0].id // I don't know if it is an array or not //If not: var gridId = viewSelector.getCurrentView().id // Now write your logic: if gridId == 'YOUR_VIEW_ID'{ return true; } else{ return false; }
For more information: Pass data from a page as a parameter to Ribbon actions (model-driven apps) - Power Apps | Microsoft Learn
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 525 Most Valuable Professional
Haque 308
Kalathiya 234 Super User 2026 Season 1