Tuesday, January 11, 2011

Linking to Activities in Dynamics CRM 4

A common request is the ability to link to an activity for reporting purposes and transparency. It might be that we create a follow-up activity if we’re using version 4 (the form assistant and therefore the follow-up function are no longer available in CRM 2011) and we want to know what activity generated the action or we might want to link an opportunity to the appointment that generated it.

The Good News: Dynamics CRM 2011

The good news this is simple in CRM 2011. The activities work a lot like every other entity so you can add relationships and therefore link to activities via a lookup. Below I’ve added a new link to a ‘Source Appointment’ for my Opportunity.


Please note you can only link to a specific type of activity e.g. appointment, task etc., not to the activity entity itself.

So Is This Yet Another Blog Telling Me How Much Better My Life Would Be If I Upgraded?

Well yes and no. Things are a lot easier in CRM 2011 but you can work around them in version 4. The biggest problem is that you cannot add relationships to the Activity entities. It lists existing relationships but there is no facility to create new ones.


So while we can set a one-to-many from Appointment to Opportunity in CRM 2011, this is not an option in CRM 4.

The Trick Is To Use Web Links

Basically, every record in CRM has a web address associated to it. You can see this in the web client in the address bar at the top. If the address bar is not visible, simply click on Ctrl-F11 and it will appear.


Therefore if we can add this URL to the Activity form, we can link back to another Activity.

This is where the other trick comes in. It is really easy to add a text attribute to a CRM form. What is not commonly known is you can force this text field to accept only web addresses. When you create the text attribute, you can specify the format as ‘URL’. Please note, increase the maximum length of this attribute to at least 200 as it is really easy for the URL to exceed 100 characters.


Getting The URL

The easiest way to get the URL is to turn on the address bar with Ctrl-F11 and copy and paste to the appropriate record. You can have CRM automatically display the web address by turning off ‘application mode’ in the back end of CRM but, in my opinion, occasionally pressing Ctrl-F11 is not a big deal and keeps the illusion you are using an application and not a web client.


There is the option of using the Copy Shortcut function under the Actions menu but this is a less elegant solution as it not only copies the URL but also a bit of text at the front with the title. The format looks like this:


When you then paste this into the field, it keeps the title but drops the actual URL. To make it work you have to do something like select the Send Shortcut option and from the resultant email record copy and paste the web address bit. This seems like a lot more work than our good friend Ctrl-F11.

So there you have it, you now have the ability to link any record to any other record (including restricted records such as activities) as long as you’re happy to click through a link.

No comments: