попробуйте так
WinOpportunityRequest wor = new WinOpportunityRequest();
opportunityclose oc = new opportunityclose();
oc.opportunityid = new Lookup();
oc.opportunityid.type = EntityName.opportunity.ToString();
oc.opportunityid.Value = new Guid(idOpportunity);
oc.statecode = new OpportunityCloseStateInfo();
oc.statecode.Value = state;
oc.statuscode = new Status();
wor.OpportunityClose = oc;
wor.Status = status;
service.Execute(wor);
|