{"id":521,"date":"2011-08-08T15:07:20","date_gmt":"2011-08-08T15:07:20","guid":{"rendered":"http:\/\/mahenderpal.wordpress.com\/?p=521"},"modified":"2011-08-08T15:07:20","modified_gmt":"2011-08-08T15:07:20","slug":"step-by-step-extending-ms-crm-2011-ribbon-part-1","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=521","title":{"rendered":"Step By Step Extending MS CRM 2011 Ribbon Part-1"},"content":{"rendered":"<p>In this part I am going to show how we can create a custom button on existing tab. Basically when adding custom button first you need to\u00a0decide where you want to put this button, as we want to add new button in existing tab we have two option for this<\/p>\n<p><strong>1.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><strong>Add button on existing group in Existing Tab.<\/strong><\/p>\n<p><strong>2.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/strong><strong>Add button on new group in Existing Tab.<\/strong><\/p>\n<p>In this post I am going do implement Option 1. let\u2019s take example and let consider we want to add a button on existing tab in account entity. You can see in account\u2019s tab we have group like save, collaborate, process and<br \/>\ndata.<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-528\" title=\"AccountRibbon1\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon1.png?w=300\" alt=\"\" width=\"300\" height=\"59\" \/><\/a><\/p>\n<p>So if we want to add a new button in existing Account tab in any of these groups let\u2019s say we want to add in \u201cProcess\u201d group.<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-529\" title=\"accountribbon2\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon2.png?w=300\" alt=\"\" width=\"300\" height=\"53\" \/><\/a><\/p>\n<p>So adding button on existing tab or group we need to know id of the parent group, that you can get from sample application provided in MS CRM 2011 SDK under <strong>\u201csdksamplecodecsclientribbonexportribbonxml\u201d<\/strong> location. Open this project and run it will ask your crm server name and organization detail and will generate entity ribbons.<\/p>\n<p>We are trying to modify Account ribbon so we need to check id in accout ribbon open account ribbon in visual studio or any xml editor. Our goal is to add button on account form and in process group so check for \u201cMscrm.Form.account.MainTab.Workflow\u201d and copy group id like below<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountriboonxml.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-522\" title=\"accountriboonxml\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountriboonxml.png?w=300\" alt=\"\" width=\"300\" height=\"67\" \/><\/a><\/p>\n<p>Now we have group id with us let\u2019s create a solution with account entity<\/p>\n<p>Follow below steps to create solution<\/p>\n<ol>\n<ol>\n<li>Goto setting-&gt;Solution-&gt;New<\/li>\n<li>Enter General information and save.<\/li>\n<li>Select Entities-&gt;Click on Add Existing and select Account.<\/li>\n<\/ol>\n<\/ol>\n<p>Your solution should look like below<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-523\" title=\"accountribbon\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/accountribbon.png?w=300\" alt=\"\" width=\"300\" height=\"60\" \/><\/a><\/p>\n<p>4. Export solution as unmanaged.<\/p>\n<p>5. Unzip your solution and open customizatio.xml in\u00a0 visual studio or in other xml editor.<\/p>\n<p>6. Search for <strong>&lt;RibbonDiffXml&gt;\u00a0<\/strong>tag<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/ribbon.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-527\" title=\"Ribbon\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/ribbon.png?w=300\" alt=\"\" width=\"300\" height=\"138\" \/><\/a><\/p>\n<p>7. We need to modify above xml to extend account ribbon. We need to add a node &lt;CustomAction&gt; under &lt;CustomActions&gt; node to add custom button.<\/p>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/instruction.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-526\" title=\"instruction\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/instruction.png?w=300\" alt=\"\" width=\"300\" height=\"82\" \/><\/a><\/p>\n<p>There are basically 3 pionts here that we need concentrate<\/p>\n<p>i. Mscrm.Form.account.MainTab.Workflow.Controls._<strong>children<\/strong>\u00a0 \u2013 \u00a0we need to use location value as parent id+\u201d_children\u201d keyword to create custom button on existing group.<\/p>\n<p>ii. Sequence \u2013 we need to set sequence of custom action and our button greater than existing values for that group<\/p>\n<p>iii. Command- we need to define command that we want to use for our custom button.<\/p>\n<p>8. We need to define a command definition for our button like below, we need to make sure that we are using the same id that we used in button node.<\/p>\n<p>&lt;CommandDefinitions&gt;<\/p>\n<p>&lt;CommandDefinition Id=&#8221;MyTest.Account.Form.CommandDefinition&#8221;&gt;<\/p>\n<p>&lt;EnableRules&gt;<\/p>\n<p>&lt;EnableRule Id=&#8221;Mscrm.Enabled&#8221; \/&gt;<\/p>\n<p>&lt;\/EnableRules&gt;<\/p>\n<p>&lt;DisplayRules\/&gt;<\/p>\n<p>&lt;Actions&gt;<\/p>\n<p>&lt;Url Address =&#8221;www.google.com&#8221;&gt;&lt;\/Url&gt;<\/p>\n<p>&lt;\/Actions&gt;<br \/>\n&lt;\/CommandDefinition&gt;<\/p>\n<ol>\n<li>save and zip your solution again and import.<\/li>\n<li>Publish all customization.<\/li>\n<li>Open account entity form you will get a button like below.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/existing-group-button.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-524\" title=\"existing group button\" src=\"http:\/\/mahenderpal.files.wordpress.com\/2011\/08\/existing-group-button.png?w=300\" alt=\"\" width=\"300\" height=\"67\" \/><\/a><\/p>\n<p><strong>In next post I will cover \u201cAdd button on new group in Existing Tab\u201d.<\/strong><\/p>\n<p><strong>Enjoy !!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this part I am going to show how we can create a custom button on existing tab. Basically when adding custom button first you need to\u00a0decide where you want to put this button, as we want to add new button in existing tab we have two option for this 1.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Add button on existing group in Existing Tab. 2.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=521\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,19],"tags":[],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/521"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=521"}],"version-history":[{"count":0,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/521\/revisions"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}