Get/Read Selected Record Information From Main View Or A Sub-Grid using Ribbon Workbench In D365 CRM

There is a common application of getting selected records information while working with custom buttons using Ribbon Workbench.

Use Case:

We had a requirement, where we needed the information of the all selected records from the Main View and Sub-Grid of an entity. We can achieve in Ribbon Workbench.

Steps:

1. The button on which we are customizing is named as “Submit”.

2. In the Command section, click on “Actions” -> “Javascript Action” to add Custom Javascript. Then click on “Add Parameter” -> Click on “Crm Parameter” -> then on  SelectedControlSelecteItemReferences.

SelectedControlSelecteItemReferences = grabs the information of all selected record from the view.

3. SelectedControlSelecteItemReferences will pass the information of all the selected records in my “selectedItems” variable passed to the method.

4. On clicking the Submit Button, the selected records information will be passed on to the Javascript Code.

5. On clicking the “Submit” button, it will pass the two selected records information to the method that the button is calling.

6. You can further read all the information from the Array and perform the actions that you want.

Note: This can be done in Sub-grids of the forms also.

Conclusion:

Hope this blog helps to get/read the selected Information from the Main View or Sub-Grid


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange