Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Javascript error: Number of concurrent requests exceeded the limit of 52

    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 95

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans