Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint 2013 JSOM : Request time out issue for just 20 records (especially on update)

$
0
0

Hi,

I am getting request timed out error on Batch update using CSOM. Below is my code. Total records that will get updated is 21. Request body size is around 8 Kb. its getting timeout after 1.5 min.

4.2 kb of another request executes on 1.5 Seconds.

function SubmitToSPListBulk(listTitle, KeyValuePairObject) {
    $('.loading').show();
    UpdateFormDigest(_spPageContextInfo.webServerRelativeUrl, _spFormDigestRefreshInterval);
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web()
        .get_lists()
        .getByTitle(listTitle);
    if (BidItemId > 0) {
        for (var i = 0; i < KeyValuePairObject.length; i++) {
            var listItem;
            if (KeyValuePairObject[i].ID <= 0) {
                var itemCreateInfo = new SP.ListItemCreationInformation();
                listItem = oList.addItem(itemCreateInfo);
            } else {
                listItem = oList.getItemById(KeyValuePairObject[i].ID);
            }
            for (var key in KeyValuePairObject[i]) {
                if (key !== "ID") {
                    listItem.set_item(key, KeyValuePairObject[i][key]);
                }
            }
            listItem.update();
            clientContext.load(listItem);
        }
        clientContext.executeQueryAsync(function () {
          
                $('.loading').hide();
            
        }, function (a, b) {
            $('.loading').hide();
            onQueryFailed(a, b);
        });
    }
}

Thanks and Regards,

Silambarasan


silambarasan.P


Viewing all articles
Browse latest Browse all 7589

Trending Articles