[null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "http://1.bp.blogspot.com/-fkUIfXyHXrM/UE-TgYiwC7I/AAAAAAAAAkY/ZXsJkNSF_8E/s640/ribbon1.png", "src": "http://1.bp.blogspot.com/-fkUIfXyHXrM/UE-TgYiwC7I/AAAAAAAAAkY/ZXsJkNSF_8E/s640/ribbon1.png", "formatted_filename": "ribbon", "rendered_width": 640, "rendered_height": 166}, null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "http://2.bp.blogspot.com/-4TF0b5qoLt0/UE-ThcEKMxI/AAAAAAAAAkg/2kcNDHJ9Fig/s640/ribbon2.png", "src": "http://2.bp.blogspot.com/-4TF0b5qoLt0/UE-ThcEKMxI/AAAAAAAAAkg/2kcNDHJ9Fig/s640/ribbon2.png", "formatted_filename": "ribbon", "rendered_width": 640, "rendered_height": 132}, null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "http://3.bp.blogspot.com/-timtP77Rtqs/UE-VOquTCeI/AAAAAAAAAlA/LK8jvygAmmc/s640/ribbon6.png", "src": "http://3.bp.blogspot.com/-timtP77Rtqs/UE-VOquTCeI/AAAAAAAAAlA/LK8jvygAmmc/s640/ribbon6.png", "formatted_filename": "ribbon", "rendered_width": 640, "rendered_height": 182}, null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "http://2.bp.blogspot.com/-V4YnPTJsaes/UE-Ti5RXWFI/AAAAAAAAAkw/HsgKSu9klMA/s640/ribbon4.png", "src": "http://2.bp.blogspot.com/-V4YnPTJsaes/UE-Ti5RXWFI/AAAAAAAAAkw/HsgKSu9klMA/s640/ribbon4.png", "formatted_filename": "ribbon", "rendered_width": 640, "rendered_height": 404}, null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "http://3.bp.blogspot.com/-StOEv64OOx0/UE-TjY2iA9I/AAAAAAAAAk4/4XwDSHvdcpY/s400/ribbon5.png", "src": "http://3.bp.blogspot.com/-StOEv64OOx0/UE-TjY2iA9I/AAAAAAAAAk4/4XwDSHvdcpY/s400/ribbon5.png", "formatted_filename": "ribbon", "rendered_width": 400, "rendered_height": 131}, null, null, {"document_url": "http://gotcrm.blogspot.com/2012/09/crm-2011-ribbon-workbench-getting-guids.html", "unformatted_src": "//4.bp.blogspot.com/-ShEkOKFkzRY/T2yXaLD9GzI/AAAAAAAAAYA/q6EUKn3fjqI/s80/mani_pic.jpg", "src": "http://4.bp.blogspot.com/-ShEkOKFkzRY/T2yXaLD9GzI/AAAAAAAAAYA/q6EUKn3fjqI/s80/mani_pic.jpg", "formatted_filename": "mani pic", "alt_text": "My photo", "rendered_width": 67, "rendered_height": 80}, null, null, null, null, null, null]

CRM 2011 Ribbon Workbench - Getting guids from selected records in the grid

For those who need to make changes to the crm 2011 ribbon, I strongly suggest that you run, not walk, and download the ribbon workbench tool from Develop1. It is so far the best utility to make painless modifications to the CRM ribbon, and also has decent write ups and articles to cover most of your needs. In this post, I will walk though a setup which grabs the selected guids from a grid view, using a button created on the entity main page.

Business Case:
Create a button on the User entity page that displays the list of the user guids selected in the grid view.

I am going to leverage the Ribbon Workbench to create the button on the User grid. The "GetIds" button will call a html web resource which contains javascript to extract and display the user guids.

Implementation Details:
1. Before we start, let us first create the webresources that we will be using when creating the button. Create a 16x16 and 32x32 png image webresource to use as the button icon. Then create a html webresource with the following code.

2. Open the ribbon workbench and select the solution. Stay on the "HomePage" (the dropdown on the top right corner) and select the user entity.

3. Drag and drop the Button from the left navigation Toolbox section to the desired location.

4. Right Click "Commands" in the Solution Elements box. Create a new command. Under Properties: Command Definition, section "Misc", click on the Action lookup icon.

5. Add an "Open Url Action". Set address value to "$webresource:<htm resource name>". Add a parameter of type "CRM parameter" with the following values: Name: "data", Value: "SelectedControlSelectedItemsIds"

6. Select the command definition created from the ButtonControl properties Command drop down. This way we associate the action of opening the html webresource to the button on click event.

Here is what the Solution Elements section looks like after the changes: Here are the properties of the command action: Here are the CRM parameter properties: And finally, the ButtonControl properties: Once the setup is similar to the above screenshots, publish the changes to the crm server. Go to the User grid, select a few of the records and click on the "Get Ids" button on the ribbon. You will see a webpage with a javascript alert like the one below: Posted by Mani Ramachandran at 12:31 PM Labels: Dynamics CRM 2011, JavaScript, Ribbon, User Experience


 Follow @Mani_Ram1