Hi,
I'm trying to update an attribute via a feature service, but keep getting an error 'TypeError: n.setAttributes is not a function at a._editHandler'. I'm using JS API 3.15. Although the error is returned, the attribute is updated successfully.
Code:
var attr = {status: 0, OBJECTID: 1};
var edits = [{attributes: attr}];
var def = statusFeatureLayer.applyEdits(null, edits, null);
def.then(function(result) {
console.log(result);
}, function(error) {
console.log(error); <-- TypeError: n.setAttributes is not a function at a._editHandler
});
Any ideas what could be causing this error? I've also tried using JS API version 3.14, but got the same error.
Thanks,
Jerry
Jerry,
The applyEdits method is expecting a array of features, which is really an array of graphics. You are just passing an object that has an attributes property?...