News Ticker

How to Tag records in Dynamics CRM?

One of the business requirements often heard from customers is “can we tag records in Dynamics CRM?”. Well, there is no out-of-the-box tagging feature available in Dynamics CRM. However, the product provides enough capability to create a record tagging framework without much effort!

I thought I would give a shot myself and came up with something like this.

Now from a high level it seems very simple: create a new Tag entity and link it to relevant entities (entity records to be tagged like Case, Account, Contact etc…) via a N:N relationship. Because a tag can be reused multiple times and a same Case or Contact record can be linked to multiple tags. This design would work only if the requirement around tagging is very basic. But if we want to bring out some kind of Business Intelligence out of this tagging like creating a nice dashboard with tag usage sliced and diced against Record Type, User, Time etc.. the N:N relationship would become a bottleneck. Because there would be more than one N:N relationship with Tag and at the Tag entity level there would be no mechanism to group them and display a consolidated metric.

To overcome this, we need to break this N:N relationship into two 1:N relationships by introducing a bridging entity. This entity would store the relationship details between a Tag and another entity record. We then can build nice consolidated metrics using this bridging entity because all entities would use the same bridging entity for maintaining their relationship with a Tag record. In this example, we would assume that we need to create tag Account, Case and Contact records.

So I decided to create the following two entities:

    1. Tag Literal, for storing the actual Tag
    2. Tag, the bridging entity (to store the link between a record and the Tag Data). I call it Tag as I intend to hide the fact from end user that they would be creating a link record. 

Tag Entity Relationships

Now let us jot down the steps of this customization:

  • Create the Tag Literal entity with only one field : Tag, the Primary Field. Make sure this entity is hidden from all areas Sales, Service, Marketing, Settings.
  • Create the Tag entity with the following fields. Make sure this entity is hidden from all areas SalesServiceMarketingSettings.

Tag Field List

The lookup fields  are actually N:1 relationships, create the relationships with entities to be tagged (e.g. Account, Contact or Case) in the following format:

Case to Tag Relationship

  • Then we would update the Tag entity Main form. Add only the Tag lookup field to the form. Hide the Primary Field called Tag from display. Do not add Account, Contact or Case lookup fields into the form. The form would look something like this:

Tag Main Form

  • The next thing would be copying the Tag lookup field data to the Primary Field “Tag” of the Tag entity. We would use a Business Rule to first default the Primary Field to a static text “Tag” and after the form save the value would be changed to the Tag lookup field value by a Synchronous workflow.

Set Tag Value Business Rule

Copy Tag Literal to Tag Workflow

  • Now write Business Rule to populate data into Record Type field. This can also be done via a Synchronous Workflow. I just thought of keeping it simple with Business Rules. Below is an example with Case entity. We have repeat this rule for all the entities to be tagged.

Set Record Type to Case

  • Once the framework is ready to store the data, now time to edit the ribbon to remove “Add Existing” button from Tag entity, so that the existing bridging relationship records are not displayed and user is always prompted to create a new relationship record with a Tag literal. Use Ribbon workbench to remove the button from the subgrid area.

Hiding Add Existing Tag Button

  • Create a Dashboard for displaying some metrics around the tags.
    • Current Month Tags
    • Current Month Tags Usage chart
    • Current Month Tags Usage by Record Type chart
    • Current Month Tags Usage by Day chart


  • The last thing would be controlling access of who can create tag, who can tag a record and who can view tags etc.. Such stuff are very easy with the help of Dynamics CRM Security Roles. I am not delving much into it here.

Now publish all customization and the below is what a user can see.

Tags in a case form

Case Tagging

Adding an Existing or a new Tag

New Tag

Similarly  the tags can be added to Accounts and Contacts records too.  Once Tags are added, a nice Tagging Dashboard can look like this:

Tagging Dashboard

Hope this helps!

About Dipankar Bhattacharya (59 Articles)
A multi-skilled Dynamics 365 Professional with strong experience in delivering IT projects especially across multiple industries. A Microsoft technology evangelist, a regular speaker at tech events, blogger and avid reader. Certified IT Architect and well versed in Solution Architecture of Business Applications using Microsoft platforms like Dynamics 365, Azure and Office 365.

2 Comments on How to Tag records in Dynamics CRM?

  1. Is this possible with CRM 2011

  2. Yes, this can be done in 2011 too

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: