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 / Subgrid Ribbon Button ...
Power Apps
Unanswered

Subgrid Ribbon Button Not Triggering JavaScript Function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to configure a custom "Deactivate" button on a subgrid ribbon in a model-driven Power App, but I'm running into an issue where clicking the button does nothing—no UI feedback, no console logs, and no errors. The same setup works perfectly for main grid, and I just applied the same settings to the subgrid but it doesn't work.

Problem Description:

  • When I select a record (in this case, a project) from a subgrid and click the custom "Deactivate" button, nothing happens.
  • The browser’s console (Edge Inspect) shows no logs or errors.
  • However, in the Network tab, I can see that the web resource library is being loaded when the button is clicked.

Expected Behavior:

  • The button should trigger a JavaScript function that checks user roles and either deactivates the selected record or shows an error message if the user lacks permission.

Ribbon Workbench Configuration Details:

  • Ribbon Workbench Setup:

    • Button added to the subgrid ribbon.
    • Set the Command on the subgrid
    • JavaScript Action:
      • Library: the webresource I uploaded
      • Function: the function that should be called.
      • Parameter: PrimaryControl (CRM Parameter)
  • Display Rules: Mscrm.CanWriteSelected,  Mscrm.SelectedEntityHasStatecode  (default out-of-the-box rules)

  • Enable Rules: Mscrm.VisualizationPaneNotMaximized,  Mscrm.SelectionCountAtLeastOne  (default out-of-the-box rules)

Observations:

  • The same setup works perfectly on the main grid.
  • The difference is that the subgrid version doesn’t trigger the JavaScript function at all.
  • I suspect the issue might be with how the parameters are passed in the subgrid context or a bug in the JavaScript function itself.

Question:

Has anyone encountered a similar issue where a subgrid ribbon button fails to trigger the associated JavaScript function? Are there any known differences in how Ribbon Workbench handles subgrid vs. main grid buttons that I should be aware of? Any insights or suggestions would be greatly appreciated!

Categories:
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    781 Super User 2026 Season 1 on at
    Microsoft suggest use SelectedControl for the grid context.
    The PrimaryControl is for the form context.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard