Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench

Whenever your Ribbon button customization involves doing something to selected records, here’s the most common application that you need to take action on the selected record’s GUIDs.

Here’s how –

CRM Parameter

In Ribbon Workbench, let’s say you have a button command which is attached to a button and it calls a method ‘process’ which looks like this (it will be your method in your case)

  1. In Commands, Custom JavaScript Action will have a CRM Parameter called as SelectedControlSelectedItemIds [pretty self explanatory 😊]

    And it’ll pass data of the selected GUIDs in my data variable passed to the method.

Read the GUIDs

Here’s my sample code where I intend to read it from the function I used to call when user clicks on the ribbon button

  1. Now, let’s say I select a few records on the Main Sub-grid where I’ve put my button on.

  2. Now, on clicking it, it’ll pass the three selected records’ GUIDs to the method that the button is calling. You can read it from the data parameter
  3. You can further read from this array and use it to perform your operations.

Hope this was easy. Here are some more Ribbon Customization related posts you might want to look at –

  1. Debug Ribbon button customization using Command Checker in Dynamics 365 CE Unified Interface
  2. Show Ribbon button only on record selection in Dynamics CRM
  3. Hide Custom Ribbon Button [Easy Way] – Ribbon Workbench
  4. [SOLVED] Navigating URL from Ribbon’s custom button in Dynamics for Phones app
  5. Fix Ribbon icons on the Unified Interface in D365 CE
  6. D365 Ribbon Button shortcut to open a Document in SharePoint Online
  7. Pass data to HTML Web Resource using browser’s sessionStorage in Dynamics 365 CE

Thank you!!


3 thoughts on “Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench

Leave a Reply

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

You are commenting using your 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.