locked
Silverlight plugin duplicate creates RRS feed

  • Question

  • Hi All,

    Having this odd issue; I have an OpportunitySet that I use to create multiple opportunities into my CRMOnline.

    What happens is that I loop through all my stackpanels that hold the controls to add info and if its valid I add the current Opportunity to the set.

                        if (!inval)
                        {   _context.AddToOpportunitySet(newOpportunity);
                            p.Children.Clear();
                        }

    When I loop back I clear the Opportunity and start fresh. After all are done I save the set with my service.

    _context.BeginSaveChanges(OnCreateOpportunityComplete, _context.OpportunitySet);

    Now where it gets funny is that it only saves the first, and if i have >2 sets it will make that first as many times equal to the number of records there should be.  BUT if i use debugger it will make all the Opportunities it's supposed to PLUS the first one multiple times over.

    I've created an Opportunity array that adds the new opportunity at the same time as the OpportunitySet to make sure there is no funny business when clearing the old data; and the data looks perfect.  My thoughts are its in the ASync calls, but if any knows why or the solution please help!

    Thank you

    Friday, November 22, 2013 3:39 PM