I am trying to Create an Opportunity record from C# for CRM 2011. This is the code I am using:
Entity opportunity = new Entity("opportunity");
opportunity["new_source"] = p.LeadOriginDetail;
opportunity["opportunityratingcode"] = new OptionSetValue(3);
opportunity["new_leadstatus"] = new OptionSetValue(100000000);
opportunity["statuscode"] = p.Type;
opportunity["ownerid"] = "Lead Share";
Guid opportunityId = orgService.Create(opportunity);
I keep getting this error “Customer not specified.” How do you add Opportunity records. The same code works for adding records to Accounts.
Thanks!
Solved it.
Had to add: