web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Javascript error: Number of concurrent requests exceeded the limit of 52

(0) ShareShare
ReportReport
Posted on by 15

I'm trying to use CRM Web API in JavaScript to perform a record creation operation inside a For clause.

This is what my code does:

1. Call retrieve multiple to bring all product related to a work order

2. Then runs a For clause to execute a child record creation (estimated item) for every retrieved product.

Everything works fine, but if I have to create several records, the asynchronous nature of the  Web API requests leads me to exceed the 52 limit.

This is the function I'm working on (record creation highlighted in the code):

function quotelogic(FirstPrimaryItemId){

//obtain the work order record ID

var woid = FirstPrimaryItemId;


console.log(woid);

var workorderid = convertGuid(woid);

// Add new Records
Xrm.WebApi.retrieveMultipleRecords("msdyn_workorderproduct", "?$select=myprefix_estimatequantity, myprefix_estimateqty, msdyn_product, msdyn_description, myprefix_estimateunit, myprefix_estimateamount, myprefix_usedquantity, myprefix_unitamount, myprefix_totalamount, msdyn_linestatus, msdyn_name&$filter=_msdyn_workorder_value eq (" + woid + ")").then(
function success(result) {

for (var i = 0; i < result.entities.length; i++) {
//console.log(result.entities[i]);
//window.alert(result.entities[i].myprefix_nextstepaging);


var estimatedquantity = result.entities[i].myprefix_estimateqty;
var description = result.entities[i].msdyn_description;
var estimatedunit = result.entities[i].myprefix_estimateunit;
var estimatedamount = result.entities[i].myprefix_estimateamount;
var quantity = result.entities[i].myprefix_usedquantity;
var unitamount = result.entities[i].myprefix_unitamount;
var totalamount = result.entities[i].myprefix_totalamount;
var linestatus = result.entities[i].msdyn_linestatus;
var product = result.entities[i].msdyn_name;


var productid = result.entities[i].msdyn_workorderproductid;

if (product.includes("Travel")==false && product.includes("Labour")==false && (linestatus==690970000 || linestatus==753950003))
{
// define the data to create a record
var data =
{
"myprefix_estimatedquantity": estimatedquantity,
"myprefix_estimatedunit": estimatedunit,
"myprefix_estimatedamount": estimatedamount,
"myprefix_items": product,
"myprefix_description": description,
"myprefix_WorkOrderId@odata.bind": "/msdyn_workorders("+workorderid+")"
}

// create estimated item record
Xrm.WebApi.createRecord("myprefix_estimateditem", data).then(
function success(result) {
console.log("Estimated Part record created");
// perform operations on record update
},
function (error) {
console.log(error.message);
// handle error conditions
}
);


}
}
},
function (error) {
console.log(error.message);
// handle error conditions
}
);
}

Any input would be very helpful

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I had issue that is similar to yours. I solved it using batching - docs.microsoft.com/.../executemultiple

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans