Monday, August 13, 2012

Activate or Deactivate record in CRM 2011

We can Activate\Deactivate record. Below is the code snippet.


For Ex.


  Entity entNewLead = new Entity("lead");
  entNewLead["leadid"] = new Guid(leadduns["leadid"].ToString());
  entNewLead["statuscode"] = new OptionSetValue(2);
  entNewLead["statecode"] = new OptionSetValue(1);
  _service.Update(entNewLead);

No comments:

Post a Comment