I never liked early-binding. Here is almost the same code written using late-binding and it works fine for me: var opportunity = new Entity("opportunity") { ["name"] = "Example Opportunity", ["pricelevelid"] = priceLevel.ToEntityReference(), ["customerid"] = account.ToEntityReference(), ["parentaccountid"] = account.ToEntityReference(), ["isrevenuesystemcalculated"] = false, ["estimatedvalue"] = new Money(400m), ["freightamount"] = new Money(10m), ["discountamount"] = new Money(0.1m), ["discountpercentage"] = 0.2m }; var oppId = service.Create(opportunity); Regarding why your code doesn't work... try to remove following lines: Id = Guid.NewGuid(), OpportunityId = Guid.NewGuid(), and EntityState = EntityState.Created,
↧