I'll try to keep this short for my first official post 🙂
I have a Model Driven App that is using an editable subgrid. Within the context of that subgrid, I have introduced a Custom Button that appears only when a record is selected. The functionality of the button is to launch a Canvas App, passing the selected record GUID and displaying a text box which defaults to showing the Comments from the record (if any) otherwise it just displays Please enter your comments here. The user would be able to enter comments and then click a button on the Canvas App to Patch those comments to the selected record, close out the Canvas App, and return to the Model Driven App with a refreshed subgrid, thus displaying the entered comments.
The issue I am having is triggering of the Canvas App via the custom button. Prior to the custom button, I added the same function to an existing JS web resource associated to the subgrid, which already has an OnSelect event, and that worked successfully. As soon as I selected a record, the canvas app launched in a separate pop up window. But since attempting to switch and leverage the Custom Button, I've had no luck. I've verified that the Function Name is correct, the JS web resource is in place correctly, and I see the JS loaded in Developer Tools. I have Visibility property configured to display the custom button when 1 record is selected, and that is also working. However, clicking the button no action occurs. I have also went through the Command Checker and I see my button definition, I see the function is correct and the library is correct (with the prefixed $webresource:).
I will add I have 2 additional custom buttons that were created using the Power Platform Command Bar Editor and those Run Formula actions without issue. So I am leaning towards something missing or not quite right with how the JS/Function is defined within the PP Command Bar Editor because as stated above, the function triggers just fine using the OnSelect event when the code is nested within an existing separate JS.
| Canvas App |  |
| Command Checker for Custom Button |  |
| Custom Button Definition in Editor |  |
| Subgrid Displaying Custom Button |  |
| Web Resource Definition |  |
| Function Definition |  |
At this point I'm running out of ideas. Any help is appreciated!