Hi All,
I am trying to updated opportunity products pricing to override and this is giving me exception
"Required bundle item cannot be updated" earlier same worked for CRm 2015 but not in CRM 2016.
Please help.
Below is the code:
EntityCollection returnCollection = ((RetrieveMultipleResponse)service.Execute(fetchRequest1)).EntityCollection;
EventLog.WriteEntry("UpdatePricingInOpportunityProducts.exceptionlog", "TotalCount for Opportunity Product is :" + returnCollection.Entities.Count.ToString(), EventLogEntryType.Information); foreach (var c in returnCollection.Entities) { Decimal price = 0M; if (c.Contains("priceperunit")) { price = c.GetAttributeValue<Money>("priceperunit").Value; } c.Attributes["ispriceoverridden"] = true; c.Attributes["new_copyofsuggestedsalesprice"] = new Money(price); service.Update(c); }
}