Tuesday 2 April 2013

Re-Open Lost Opportunity in MS CRM 2011 using C#



Here is same code

try
{
OrganizationRequest _request = new OrganizationRequest();
_request.RequestName = "SetState";
_request.Parameters = new Microsoft.Xrm.Sdk.ParameterCollection();

_request.Parameters.Add(new KeyValuePair<string, object>("EntityMoniker", new EntityReference() { Id = _ID, LogicalName = "opportunity" }));
_request.Parameters.Add(new KeyValuePair<string, object>("Status", new OptionSetValue() { Value = 1 }));
_request.Parameters.Add(new KeyValuePair<string, object>("State", new OptionSetValue() { Value = 0 }));

_Service.Execute(_request);

}
catch (Exception _ex)
{
throw _ex;
}

2 comments:

  1. Thx a ton !

    WTB a ReOpenOpportunityRequest !

    ReplyDelete
  2. It is quite beneficial, although think about the facts when it reaches this target. database management

    ReplyDelete