AnsweredAssumed Answered

applyedits with setAttributes

Question asked by ihussein1 on Feb 20, 2015
Latest reply on Feb 20, 2015 by ihussein1

Hey guys, first time using applyedits so Im a little confused on the process.

 

I have a graphic that id like to add to a feature layer. so I have the graphic and I am able to add just the graphic to the feature layer. but the user needs to add the attributes themselves otherwise everything is pretty much null. I am trying to set attributes before the apply edits that way a lot of the attributes can be set automatically, but I get an error that says

 

{code: 500, message: "Unable to complete operation.", details: Array[0], log: undefined, httpCode: 500…}

 

Code:

  map.graphics.on("click", function(evt) {
     console.log("click graphic");
     evt.graphic.setAttributes( {"OBJECTID":2312,"PARCELID":"1231233","STATUS":"RETIRED"});//test values
     FeatureLayr.applyEdits([evt.graphic],null,null,null,errCallback);
});


});   });

 

If I remove line 3 above (setAttributes) a dialog comes up to enter the attributes, but if I have the set attributes code I get that error. not sure I understand what the error is saying. 

Outcomes