Hide “+” and “See Associated records” buttons in subgrid based on value of a field

  • Create a web resource with a simple JavaScript method that will return true or false depending on the value that you want to validate, find below an example:
  1. Create a new solution with only the Entity that you want to customize (The entity of the subgrid).
  2. Open XRM Toolbox -> Ribbon Workbench.
  3. Open the Solution created in step 1.
  4. Locate the following buttons:

5. Right click on one and then click on “Customize Command”

6. Search for the command created, click on it and then click on “Add Enable Rule”

7. Click on “Add Step” and finally in “Custom Rule”:

8. Change the “Id” with a proper name, change the “FunctionName” with the name of the function created in web resource in our first step. Finally, in “Library” select the web resource in the first step.

NOTE: For the second button to be customized, you can just select the Enable rule that you already created, this means that you will only need to right click on the button, click on “Customize Command”, select it and in the Enable Rules section add the one created above.

9. Click on Publish.

Hope it helps!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s