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

11 comments

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

Reply

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

Reply

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

Reply

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

Reply

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

Reply

The strong typed entities class is generated using crmsvcutil.

Please go through CRM SDK doc on how to use this to generate the class.

Reply

Thnx a lotttt....

Reply

thanks so so much...

Reply

I'm trying to compile this with the CRM 2013 SDK and it can't find a reference assembly for OrgServiceContext. Do I need to change the object for this in CRM 2013 or did I not get it included in the Org.Entities.CRM namespace I created using crmsvcutil?

Reply

Hi,

OrgServiceContext will be the service context you generate from crmsvcutil, whathever you name the service context to be.

Reply

Thank you for your sharing!
Let's say email activity!
what if a user just modify email set-regarding field from empty to AN EXISTED case.
It's going to copy description even this is not convention?

Reply

Post a Comment