Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested

$
0
0

hi sir,

I have try to update task assignments using csom model.

 erro message ::The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested

 foreach (PublishedAssignment assignItem in item.Assignments)
                        {
                            Guid id =assignItem.Id;
                           cc.Load(assignItem, a => a.Resource,a=>a.PercentWorkComplete);
                           cc.ExecuteQuery();

                           EnterpriseResource er = cc.EnterpriseResources.GetByGuid(assignItem.Resource.Id);

                       
                         
                         
                           cc.Load(item.Assignments,c=>c.Where(uu=>uu.Id==id).IncludeWithDefaultProperties( l=> l.Task.Assignments,l=>l.Work));
                           cc.ExecuteQuery();
                           er.Assignments.Single(ll => ll.Id == id).Work = "9";
                           cc.Load(er);
                           cc.ExecuteQuery();
                           StatusAssignmentCollection sac = er.Assignments;
                            
                           sac.Update();
                           sac.SubmitAllStatusUpdates("hello vijay");


vijay


Viewing all articles
Browse latest Browse all 5347

Trending Articles



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