private SetStateRequest inactiveQuote(Entity entSuspect)
{
//to set prospect record inactive
SetStateRequest setState = new SetStateRequest();
setState.EntityMoniker = new EntityReference();
//Pass GUID of the record to be activated or Deactivated
WinOpportunityRequest oppState = new WinOpportunityRequest();
oppState.OpportunityClose.EntityState = 0;
setState.EntityMoniker.Id = entSuspect.Id;
setState.EntityMoniker.Name = "quote";
setState.EntityMoniker.LogicalName = entSuspect.LogicalName;
//Setting ‘State’ i.e., (0 – Active ; 1 – InActive)
setState.State = new OptionSetValue();
setState.State.Value = 1;
oppState.Status = new OptionSetValue(3);
//Setting ‘Status’ i.e., (1 – Active ; 2 – InActive)
setState.Status = new OptionSetValue();
setState.Status.Value = 3;
return setState;
//
}
{
//to set prospect record inactive
SetStateRequest setState = new SetStateRequest();
setState.EntityMoniker = new EntityReference();
//Pass GUID of the record to be activated or Deactivated
WinOpportunityRequest oppState = new WinOpportunityRequest();
oppState.OpportunityClose.EntityState = 0;
setState.EntityMoniker.Id = entSuspect.Id;
setState.EntityMoniker.Name = "quote";
setState.EntityMoniker.LogicalName = entSuspect.LogicalName;
//Setting ‘State’ i.e., (0 – Active ; 1 – InActive)
setState.State = new OptionSetValue();
setState.State.Value = 1;
oppState.Status = new OptionSetValue(3);
//Setting ‘Status’ i.e., (1 – Active ; 2 – InActive)
setState.Status = new OptionSetValue();
setState.Status.Value = 3;
return setState;
//
}