Posted on 24. March 2012

Rename a standard CRM2011 Tab

Occasionally the built-in names for Ribbon tabs need to be changed. Using the Ribbon Workbench for CRM2011 makes this very easy.

1. Create a solution with the entity you want to change.

2. Open the Ribbon Workbench for CRM2011 and select your solution.

3. Find the tab you want to change. If you want to customise the Form Tabs, you'll need to select the 'Form' value in the drop down in the top right.

If you wanted to change the 'Add' tab on the Account form, you would add the 'Account' entity to the solution, and select the 'Form' tab in the workbench:

4. Select the 'Add' tab and use the 'right click' menu to 'Customise Tab'. This will mark each element within the tab as customised so you are free to rename/edit/add to.


5. Select the 'Add' tab and in the right hand properties, rename the TabTitle to whatever you want:

6. Click Publish Solution, and you will then see your tab renamed:

The Ribbon Workbench for CRM 2011 is a free download.

If you find an issue with the Ribbon Workbench for Dynamics CRM 2011 or have any suggestions,please send it here.

Happy Ribbon Customising!

 

Posted on 23. March 2012

Make sure ribbon buttons appear in Outlook

There are some marked differences in the way that the Ribbon is handled between Outlook and the Web Client of Dynamics CRM.

Mandatory DisplayRule and EnableRule

In the Web Client you can create buttons that refer to a command with just an action. If you want to make the button appear in Outlook, you need to have both a display rule and en enable rule.

If you don't add at least one of each, you will not see your button because Outlook is failing to evaluate the rules. To see the reason why buttons are not showing up, you need to turn on Developer Debug messages in Outlook :

(Options->Advanced->Show add-in user interface errors)

Restart outlook and you will get the following error message:

An exception occurred while calling function "HrExplorerServerButtonGetVisible"

To correct this, using the Ribbon Workbench, the minimum you should have is a Display Rule and an Enable Rule both added to your Command. Each rule should have an OrEnableRule that detects either the Web or Outlook Client.

This gives the following Ribbon Xml:

<CommandDefinitions>
    <CommandDefinition Id="new.ApplicationRibbon.Command0.Command">
      <EnableRules>
        <EnableRule Id="new.ApplicationRibbon.EnableRule0.EnableRule" />
      </EnableRules>
      <DisplayRules>
        <DisplayRule Id="new.ApplicationRibbon.DisplayRule0.DisplayRule" />
      </DisplayRules>
      <Actions>
        <Url Address="about:blank" WinMode="0" />
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules>
      <DisplayRule Id="new.ApplicationRibbon.DisplayRule0.DisplayRule">
        <OrRule>
          <Or>
            <CrmClientTypeRule Type="Outlook" />
          </Or>
          <Or>
            <CrmClientTypeRule Type="Web" />
          </Or>
        </OrRule>
      </DisplayRule>
    </DisplayRules>
    <EnableRules>
      <EnableRule Id="new.ApplicationRibbon.EnableRule0.EnableRule">
        <OrRule>
          <Or>
            <CrmClientTypeRule Type="Web" />
          </Or>
          <Or>
            <CrmClientTypeRule Type="Outlook" />
          </Or>
        </OrRule>
      </EnableRule>
    </EnableRules>
  </RuleDefinitions>

Actually it doesn't matter what rules you use, provided there is at least one and it evaluates as true for both Outlook and the Web Client.

Unique ID's

In the Web Client, each Homepage ribbon is loaded on the fly within a browser window. In Outlook, all of these ribbons are loaded on start up. If you don't have unique identifiers for all CustomActions and Buttons, you will receive the error:

Error Found in Custom UI XML of "Microsoft Dynamics CRM"
"The ID CrmOrg.<GUID>.<Button ID>' is duplicated"

This issue was originally described by http://blog.sonomapartners.com/2011/08/ribbon-errors-in-outlook-add-in-for-dynamics-crm-2011.html

The most recent version of the Ribbon Workbench for Dynamics CRM 2011, ensures that when you add a button to a group on a tab that is duplicated for more than one entity (i.e. The Application Ribbon tabs), it add '{!EntityLogicalName}' into the ID, so that no two ID will be the same.

E.g.

<CustomAction Id="new.ApplicationRibbon.{!EntityLogicalName}.Button12.Button.CustomAction" Location="Mscrm.HomepageGrid.{!EntityLogicalName}.MainTab.Management.Controls._children" Sequence="45">
      <CommandUIDefinition>
        <Button Id="new.ApplicationRibbon.{!EntityLogicalName}.Button12.Button" LabelText="$LocLabels:new.ApplicationRibbon.Button12.Button.LabelText" Sequence="45" TemplateAlias="o2" />
      </CommandUIDefinition>
    </CustomAction>

Thanks to Peter Hörnell for his help with this one.