Select to view content in your preferred language

Error on applyEdits

3416
1
01-19-2016 11:25 PM
JerryStafurik
Emerging Contributor

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

Tags (1)
1 Reply
RobertScheitlin__GISP
MVP Emeritus

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?...

0 Kudos