torsdag 19 december 2013

New feature in CRM 2013 on activities

I have been struggling with a problem to relate emails to "parent email", i.e. the email you're replying to, during the past week. The upgrade to CRM 2013 made on of our solutions very much obsolete. The solution of the problem did make me happy though, good work Microsoft!

We created a solution in CRM 2011 where the sender address was set to the address of the queue the email was in instead of the user. This is very much a standard configuration of pretty much ALL ticket systems I have been working in while being a support engineer. That the service parts of CRM doesn't have this feature out of the box is a mystery to me.

The old solution was to use a queryattribute called _InReplyToId, which was the GUID of the email you were replying to. The queryattribute wasn't present in CRM 2013 and I have been looking for a solution ever since. The solution was in fact very simple, Microsoft has provided a connection to parent activity called ParentActivityId. When responding to an email this field is populated with a lookup to the original email, just add the field to the form and you can access this with regular JS code.

To set the sender address to the address of the queue you will have to look up the queue item of the parent email, and fetch the queue from that. I chose to to this with an OData call which I've grown quite fond of the past months.

I think this will help quite a lot and it's really a great feature of the new CRM.

Rickard Norström
Developer at CRM-Konsulterna    

2 kommentarer:

  1. Hi Richard,

    Any change you could make available the script to retrieve the queue nqme from the parent?


  2. Hi Rocky,
    The ODATA-query-url looks like this. From that answer you can get the Queue Id which is what you want to use.
    http://CRMSERVER/ORGONE/XRMServices/2011/OrganizationData.svc/QueueItemSet?$select=QueueId,ObjectId&$filter=ObjectId/Id eq guid''