/ Published in: C#
How to set opportunity status to WON
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private void WinOpportunity(IOrganizationService organizationService, Opportunity opportunity) { OpportunityClose oppClose = new OpportunityClose { OpportunityId = opportunity.ToEntityReference(), Subject = "Won!", ActualEnd = DateTime.Now, Description = "Won!", }; { OpportunityClose = oppClose, RequestName = "WinOpportunity", }; var response = (WinOpportunityResponse)organizationService.Execute(req); var results = response.Results; }