Wednesday, May 20, 2015

Close Opportunity as Lose

LoseOpportunityRequest loseReq = new LoseOpportunityRequest();
Entity OpportunityClose = new Entity("opportunityclose");
OpportunityClose.Attributes.Add("opportunityid", eOpportunity);
OpportunityClose.Attributes.Add("actualend", DateTime.Now);
OpportunityClose.Attributes.Add("actualrevenue", 0);
loseReq.Status = new OptionSetValue(((OptionSetValue)context.InputParameters["Status"]).Value);
loseReq.OpportunityClose = OpportunityClose;
service.Execute(loseReq);

No comments:

Post a Comment