web
You’re offline. This is a read only version of the page.
close
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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans