Microsoft Dynamics CRM 2011 – Define Ribbon Display Rules


When configuring ribbon elements, you can define specific rules to control when the ribbon elements will display.

  • Use the /RuleDefinitions/DisplayRules/<DisplayRule> (RibbonDiffXml) element to define rules controlling when the ribbon element should be displayed.
  • Use the /CommandDefinitions/CommandDefinition/DisplayRules/<DisplayRule> (RibbonDiffXml) element to associate specific display rules to a command definition.

Control When Ribbon Elements Are Displayed

By defining display rules in rule definitions, you can use the same display rule for many command definitions. When more than one display rule is defined for a command definition, all of the display rules must evaluate as true for the ribbon element to be displayed.

All display rules provide an optional attribute to specify whether the default value of the rule is true or false and an optional InvertResult attribute to enable returning a negative result when the item being tested returns true.

The /RuleDefinitions/DisplayRules/DisplayRule element supports the following types of rules:

<CrmClientTypeRule> (RibbonDiffXml)

Allows definition of rules depending on the type of client used. Type options are as follows:

  • Web
  • Outlook

<EntityPropertyRule> (RibbonDiffXml)

Allows definition of rules depending on the Boolean values of specific entity properties. PropertyName options are as follows:

  • DuplicateDetectionEnabled
  • GridFiltersEnabled
  • HasStateCode
  • IsConnectionsEnabled
  • MailMergeEnabled
  • WorksWithQueue
  • HasActivities
  • IsActivity
  • HasNotes

<EntityRule> (RibbonDiffXml)

Entity rules allow for evaluation of the current entity. This is useful when you define custom actions that apply to the entity template instead of for specific entities. For example, you may want to add a ribbon element to all entities except for some specific entities. It is easier to define the custom action for the entity template that applies to all entities and then use an entity rule to filter out those that should be excluded.

The entity rule also includes an optional context attribute to specify whether the entity is being displayed in the form or a list (HomePageGrid). The optional AppliesTo attribute can be set to PrimaryEntity or SelectedEntity to distinguish whether the entity is being displayed in a subgrid.

<FormStateRule> (RibbonDiffXml)

Use the form state rule to determine the current type of form that is displaying a record. State options are as follows:

  • Create
  • Existing
  • ReadOnly
  • Disabled
  • BulkEdit

<OrRule> (RibbonDiffXml)

This rule lets you override the default AND comparison for multiple display rule types. Use the OrRule element to define several possible valid combinations to check.

<CrmOutlookClientTypeRule> (RibbonDiffXml)

Use this rule if you want to display a button for the specific type of Microsoft Dynamics CRM for Microsoft Office Outlook. Type options are as follows:

  • CrmForOutlook
  • CrmForOutlookOfflineAccess

<CrmOfflineAccessStateRule> (RibbonDiffXml)

Use this criteria to display a ribbon element based on whether Microsoft Dynamics CRM for Microsoft Office Outlook with Offline Access is currently offline.

<OrganizationSettingRule> (RibbonDiffXml)

Use this to display a ribbon element if specific organization settings are enabled. Setting options are as follows:

  • IsSharepointEnabled
  • IsSOPIntegrationEnabled
  • IsFiscalCalendarDefined

<OutlookRenderTypeRule> (RibbonDiffXml)

Use this to display a ribbon element if the ribbon is being displayed in Microsoft Outlook in a specific way. Type options are as follows:

  • Web
  • Outlook

<OutlookVersionRule> (RibbonDiffXml)

Use this to display a ribbon element for a specific version of Microsoft Outlook. Version options are as follows:

  • 2003
  • 2007
  • 2010

<RelationshipTypeRule> (RibbonDiffXml)

This type of rule is applied to records selected in a grid. It lets you determine the type of relationship, as follows:

  • OneToMany
  • ManyToMany
  • NoRelationship

<PageRule> (RibbonDiffXml)

This type of rule checks the URL of the page being displayed. It returns true if the address matches.

<EntityPrivilegeRule> (RibbonDiffXml)

Use this kind of rule to display ribbon elements when a user has specific privileges for an entity. You must specify the privilege depth and the specific privilege you want to check.

<MiscellaneousPrivilegeRule> (RibbonDiffXml)

Use this kind of rule to check for privileges that do not apply to a specific entity, such as ExportToExcel, MailMerge, or GoOffline.

<SkuRule> (RibbonDiffXml)

Use this kind of rule to display a ribbon element for a specific SKU version of Microsoft Dynamics CRM, as follows:

  • OnPremise
  • Online
  • Spla

<ValueRule> (RibbonDiffXml)

Use this rule to check the value of a specific field in the record being displayed in the form.

My above blog is based on Microsoft’s Official information.

I hope this blog about ‘Microsoft Dynamics CRM 2011 – Define Ribbon Display Rules’ was informative. Please feel free to leave your comments.

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: