You cannot load dependent objects for more than 1000 resources. Use a filter to restrict your query.

%3CLINGO-SUB%20id%3D%22lingo-sub-2350306%22%20slang%3D%22en-US%22%3EYou%20cannot%20load%20dependent%20objects%20for%20more%20than%201000%20resources.%20Use%20a%20filter%20to%20restrict%20your%20query.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2350306%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20on-premise%20SharePoint%202019%20and%20MS%20Sql%20Server%202019.%26nbsp%3B%3CBR%20%2F%3EI%20use%20CSOM%20to%20set%20actual%20work%20for%20resources.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Epublic%20TimePhase%20getResourceTimePhaseAssignments(EnterpriseResource%20resource%2C%20DateTime%20startDate%2C%20DateTime%20finishDate)%0A%7B%0ATimePhase%20currentTimePhase%20%3D%20resource.Assignments.GetTimePhase(startDate%2C%20finishDate)%3B%0AprojContext.Load(currentTimePhase.Assignments)%3B%0AprojContext.ExecuteQuery()%3B%0Areturn%20currentTimePhase%3B%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERunning%20this%20code%20I%20get%20exception%3A%26nbsp%3BToo%20many%20resources%3A%201073.%20You%20cannot%20load%20dependent%20objects%20for%20more%20than%201000%20resources.%20Use%20a%20filter%20to%20restrict%20your%20query.%3C%2FP%3E%3CP%3EI%20found%20several%20unanswered%20threads%20related%20to%20this%20issue%3A%3C%2FP%3E%3CP%3E1)%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.microsoft.com%2FForums%2Fen-US%2Fb0375b33-808d-439d-bb49-20ca0a02c695%2Fyou-cannot-load-dependent-objects-for-more-than-1000-resources-use-a-filter-to-restrict-your-query%3Fforum%3Dprojectonline%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.microsoft.com%2FForums%2Fen-US%2Fb0375b33-808d-439d-bb49-20ca0a02c695%2Fyou-cannot-load-dependent-objects-for-more-than-1000-resources-use-a-filter-to-restrict-your-query%3Fforum%3Dprojectonline%3C%2FA%3E%3C%2FP%3E%3CP%3E2)%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fazure%2Fen-US%2F4fab5f62-5955-4257-af0f-a5e1fa58dca7%2Ferror-reading-project-custom-fields-via-csom-too-many-projects%3Fforum%3Dprojectonline%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fazure%2Fen-US%2F4fab5f62-5955-4257-af0f-a5e1fa58dca7%2Ferror-reading-project-custom-fields-via-csom-too-many-projects%3Fforum%3Dprojectonline%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20didn't%20find%20any%20decision%20for%20my%20case.%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20an%20ability%20to%20change%20limit%20of%201000%20resources%20somewhere%20on%20the%20server%20side%3F%3C%2FP%3E%3CP%3EAm%20I%20able%20to%20filter%20my%20request%20somehow%3F%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi, I have on-premise SharePoint 2019 and MS Sql Server 2019. 
I use CSOM to set actual work for resources.

 

public TimePhase getResourceTimePhaseAssignments(EnterpriseResource resource, DateTime startDate, DateTime finishDate)
{
TimePhase currentTimePhase = resource.Assignments.GetTimePhase(startDate, finishDate);
projContext.Load(currentTimePhase.Assignments);
projContext.ExecuteQuery();
return currentTimePhase;
}

 

Running this code I get exception: Too many resources: 1073. You cannot load dependent objects for more than 1000 resources. Use a filter to restrict your query.

I found several unanswered threads related to this issue:

1)

https://social.microsoft.com/Forums/en-US/b0375b33-808d-439d-bb49-20ca0a02c695/you-cannot-load-depen...

2)

https://social.technet.microsoft.com/Forums/azure/en-US/4fab5f62-5955-4257-af0f-a5e1fa58dca7/error-r...

 

I didn't find any decision for my case. 

Is there an ability to change limit of 1000 resources somewhere on the server side?

Am I able to filter my request somehow?

Any help would be appreciated.

0 Replies