Mark Activity as Complete

Paramerter _type is activity type like : Fax,Email,Letter,Appointment,Task



void CompleteActivity(string _activityid, string _type)



ServerConnection serverConnect = newServerConnection();


ServerConnection.Configuration config = serverConnect.GetServerConfiguration();


OrganizationServiceProxy _serviceProxy;


var creds = newClientCredentials();


using (_serviceProxy = newOrganizationServiceProxy(config.OrganizationUri,






// This statement is required to enable early-bound type support.





IOrganizationService service = (IOrganizationService)_serviceProxy;



SetStateRequest setState = newSetStateRequest();

setState.EntityMoniker =



setState.EntityMoniker.Id =



setState.EntityMoniker.Name = _type;

setState.EntityMoniker.LogicalName = _type.ToString().ToLower();

setState.State =



setState.State.Value = 1;

setState.Status =



setState.Status.Value = -1;


SetStateResponse setStateResponse = (SetStateResponse)_serviceProxy.Execute(setState);





This entry was posted in MS Dynamic CRM 2011. Bookmark the permalink.

10 Responses to Mark Activity as Complete

  1. tipografie says:

    The ideas you have given here are quite valuable. It absolutely was such a fun surprise to have that looking forward to me after i woke up this very day. They are constantly to the point and easy to understand. Thank you so much for the innovative ideas you have shared here.

  2. design says:

    Many thanks for your time and energy to have put these things together on this web site. Janet and i also very much loved your insight through the articles on certain things. I am aware that you have quite a few demands on your own schedule hence the fact that you actually took all the time like you did to guide people like us by this article is also highly appreciated.

  3. online games says:

    Thanks a lot for your efforts to have decided to put these things together on this blog site. Jack and i also very much liked your insight through your own articles in certain things. I’m sure that you have a variety of demands on timetable hence the fact that you took the maximum amount of time as you did to help people really like us by way of this article is also highly appreciated.

  4. We so appreciate your website post. There are a multitude of techniques we could put it to proper use while having minimum effort with time and hard earned cash. Thank you very much pertaining to helping have the post answer many questions we have come across before now.

  5. It was something of great pleasure finding your site this morning. I came here this day hoping to learn something new. I was not dissatisfied. Your ideas in new strategies on this topic were useful and a terrific help to me. Thank you for creating time to create these things and for sharing your notions.

  6. What would we do minus the excellent thoughts you reveal on this site? Who else has got the patience to deal with vital topics for the health of common visitors like me? I actually and my friends are very delighted to have your web site among the types we frequently visit. We hope you know how much we value your working hard! Best wishes through us all.

  7. We so appreciate your website post. There are actually a multitude of means we could put it to good use while using little or no effort with time and resources. Thank you very much pertaining to helping make this post respond to many concerns we have had before now.

  8. What would most people do without the marvellous concepts you write about on this site? Who else has got the endurance to deal with crucial topics in the interests of common readers like me? I actually and my buddies are very delighted to have your blog among the types we typically visit. Hopefully you know how much we appreciate your efforts! Best wishes coming from us all.

  9. It’s rare to discover an experienced person in whom you can have some trust. In the world at present, nobody truly cares about showing others the way in this matter. How fortunate I am to have found such a wonderful blog as this. It’s people like you who really make a true difference nowadays through the strategies they reveal.

  10. All I can state is, I am not sure what to say! Except of course, for the amazing tips that happen to be shared using this blog. I’m able to think of a million fun tips on how to read the articles on this site. I do think I will finally make a move using your tips on that matter I could never have been able to manage alone. You’re so careful to let me be one of those to benefit from your handy information. Please realize how considerably I am thankful.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>