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 />'); });
{ "addResults": [], "updateResults": [ { "objectId": 1094, "success": true } ], "deleteResults": [] }
Solved! Go to Solution.
One thing I'm trying to remember is if I delete a well point, does the relationship class delete the related records or do I have to handle that in my code?
Hello,
Example 1 :
var map = new Map("map", {
basemap: "dark-gray",
zoom: 3,
});
layer = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");
attributes = { objectid: 119369, typdamage: "Update successfully" };
feature = new Graphic( null, null, attributes );
map.addLayer(layer);
map.onLayerAddResult = () => {
layer.applyEdits(null, [feature], null,
function (add, update, del) {
console.log('success', update);
});
};
Exemple 2 :
var map = new Map("map", {
basemap: "dark-gray",
zoom: 3,
});
layer = new FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");
attributes = { objectid: 119369, typdamage: "Update successfully" };
feature = new Graphic( null, null, attributes );
map.addLayer(layer);
setTimeout(() => {
layer.applyEdits(null, [feature], null,
function (add, update, del) {
console.log('success', update);
},
function (error) {
console.log('error applyEdits \n', error);
});
}, 2000);
Bertrand