[Quick Tip] Get SubGrid View Id using Primary Control or Selected Control for Ribbon button’s enable rule in Dynamics 365 CRM.

Amit Prajapati
2 min readMar 28, 2021

Use case: I have two entity Awards and Awards category. We have SubGrid on the Awards entity form for Category with Custom Ribbon button. We want to have the button should be visible on specific view only and below are steps to do so.

Step 1: Configure the Ribbon Button

Create a Ribbon Button, create a command and enable rule. Added enable to Command and command to ribbon button. To enable rule, create a custom rule and pass the JavaScript and parameter.

RIbbon Workbench Dashboard

Step 2: Get View id based on the CRM parameter:

Now, Get Subgrid view id by passing the CRM parameter in the custom rule.

When CRM parameter is Primary Control

When CRM parameter is Selected Control

--

--

Amit Prajapati
Amit Prajapati

Written by Amit Prajapati

I am Technical Consultant from Mumbai, India. I like to contribute my knowledge to the community and good social cause.

No responses yet