CRM 2011 Convert Activity to Case - Populate Case Details

When converting an activity (such as Phone Call) to case, we can only specify the Customer and the Subject on the popup dialog. What if we want to auto-populate the case details with the information from the activity?

At first I thought we can write a plugin that triggers on the post-create of a case. However this is not possible since CRM creates the Case before it sets the Regarding field on the Activity.

The workaround for this is to create the post-update plugin on the Activity itself. This way when the Regarding field is assigned by CRM, it will look for the Case and update its details.



Be careful though because this might not work when converting Activity to Case from Outlook. I read somewhere that when converting Email to Outlook, the Regarding field is set to the Parent Customer of the Case rather than the Case itself.

Hope this helps,
Andreas

Comments

  1. hey good work

    can i use this code and change it to work for me when am converting an email from the queue into a case...so that the case description picks up the email content??

    and if its possible give me some guidelines ..am new with CRM 2011

    ReplyDelete
    Replies
    1. Hi,

      you should be able to do the same with the email. When the email is converted to a case then the email regarding field will be set to that case.

      So using the same approach as the above, you can grab the case (from the regarding field) in the post create plugin of the email and populate its fields.

      The other approach that people have used is to create a custom workflow that checks the emails directed to a queue and create the case. This is not using the standard Convert button. However workflow jobs can be expensive and it's dependent on async service so I tend to go with plugin whenever possible.

      HTH,
      Andreas

      Delete
  2. Hi,
    I am new to CRM and find your post helpful.
    One point that I could not understand is why the plugin needs to be registered on post-update event of Activity itself. Though you have given some explanation but that I am unable to understand. Could you please elaborate some more.

    Thanks
    Rajesh

    ReplyDelete
    Replies
    1. Hi Rajesh,

      Sure. What we want is to populate the some of the Case details from the Activity. For this to happen, you would need to know which Activity it is related to (of course :) )

      As I mentioned before, CRM creates the case before it sets the 'Regarding' field. If we were about to do it on the Case plugin, then the 'relationship' is not established yet and we would not be able to know which Activity it is related to.

      Therefore we do it on the Activity plugin, because when the 'Regarding' field is set by CRM, the plugin will get triggered and we will then populate the case details.

      Hope this makes a bit clearer,
      Andreas

      Delete
  3. hi,
    i'm looking for Org.Entities.Crm; in vs 2010 but there isn't any dll or class in this type
    can you give me this?
    or how can i get it?
    the PhoneCall Method that you used in this application has not been found and need this dll i think!
    if you can send it to me or put it in this page
    my email address is: kzi.afshin@gmail.com
    Thanks
    Afshin

    ReplyDelete

Post a Comment

Popular posts from this blog

SharePoint 2013 anonymous access add attachments to list item

CRM Plugin - Parent and Child Pipeline

Sitecore custom publish agent from specific node and at a specific time