Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Dynamics CRM 2016 online exception "Required bundle item cannot be updated"

$
0
0

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);
                         }



}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>