We got a requirement to Enable\disable ribbon button based on selected view.

We used JScript to disable the button by getting the selected view name.
Below is the script to get the selected view name of Main Grid
var viewName = “”;
if (crmGrid && crmGrid.control) {
viewName = crmGrid.control.get_viewTitle();
}
🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment