AnsweredAssumed Answered

FeatureLayer.applyEdits() always erroring on update when it actually worked

Question asked by mtdave on Oct 29, 2013
Latest reply on Dec 20, 2017 by blaurancinesrifrance-fr-esridist
I am am using the FeatureLayer.applyEdits() method to update the attributes of a feature layer. The method is working and the attributes are being updated correctly but the callback always errors. When I look at the network response from the method it looks like the REST returned a correct 'operation completed' JSON object. The FeatureLayer.applyEdits() method seems to be erroring in parsing the REST response to the callback.

var feat = {     "attributes": {         "OBJECTID": 1094,         "Well_ID": 565656,         "GWIC_ID": "efg789",         "Geomethod_ID": 5,         "Township": "1N",         "Range": "1E",         "Section_": "1",         "Quarter_Section": "sw ne",         "Physical_Address_WellName": "Baxter and Puckett",         "Subdivision": "Test point 07",         "City_ID": 4,         "TotalDepth_ft_": "87"     } };  Feat_Layer01.applyEdits(null,[feat],null,function(res){     console.log('worked: '+dojo.toJson(res));     /*     if (res.length > 0){         if (res[0].success){             Ext.MessageBox.alert('MESSAGE', 'Updated well objectid: '+updres[0].objectId);         }         else {             Ext.MessageBox.alert('MESSAGE', 'Well update unsuccessful');         }     }     else {         Ext.MessageBox.alert('MESSAGE', 'Well objectid not found');     }     */ },function(er){     console.log('errored: '+dojo.toJson(er));     //Ext.MessageBox.alert('ERROR', 'Update Error:<br />'); }); 


It always goes to the Errorback function.

REST Response as seen in the Network Tab of JS development console:
{     "addResults": [],     "updateResults": [         {             "objectId": 1094,             "success": true         }     ],     "deleteResults": [] }


Is this a bug in the ArcGIS Server Javascript API? I can probably live with it for now since the edit is actually working but I'd prefer if the callback worked correctly.

Thanks, Dave

Outcomes