File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # ###############################################################################
2+ # This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3+ # ###############################################################################
4+
5+ /.vs /Dataverse REST Builder /CopilotIndices /0.2.1653.9816
6+ /.vs /Dataverse REST Builder /FileContentIndex
7+ /.vs /DRB /v17
Original file line number Diff line number Diff line change @@ -188,11 +188,17 @@ DRB.Xrm.RetrieveBatch = function (queries) {
188188 * @param {any[] } batchedQueries Batched Queries
189189 */
190190DRB . Xrm . RetrieveBatches = function ( batchedQueries ) {
191+ var MaximumBatchSize = 100 ;
191192 var xrmCalls = [ ] ;
192193 batchedQueries . forEach ( function ( batchedQuery ) {
193194 var queries = [ ] ;
194195 batchedQuery . forEach ( function ( query ) { queries . push ( query ) ; } ) ;
195- xrmCalls . push ( DRB . Xrm . RetrieveBatch ( queries ) ) ;
196+
197+ // Split queries into smaller batches of 100 or fewer operations
198+ for ( var i = 0 ; i < queries . length ; i += MaximumBatchSize ) {
199+ var batch = queries . slice ( i , i + MaximumBatchSize ) ;
200+ xrmCalls . push ( DRB . Xrm . RetrieveBatch ( batch ) ) ;
201+ }
196202 } ) ;
197203 return $ . when . apply ( $ , xrmCalls ) ;
198204}
You can’t perform that action at this time.
0 commit comments