Update feature - applyEdits - Cannot read property 'attributes' of undefined

10-09-2018 09:24 AM
New Contributor II

Hi Guys
I'm trying to make a simple update using applyEdits function as shown in the code below but I'm getting the error "Cannot read property 'attributes' of undefined".

What I'm doing wrong?

featureUpdateClandestino: null,

searchById: function(){

   var featLyrClandestino = new esri.layers.FeatureLayer(this.URL_Clandestino_Feature,

   //get object
   var query = new esri.tasks.Query();
   query.where = "OBJECTID = "+ this.objecIdClandestino;

   var queryDeferred = featLyrClandestino.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW);
      function (features)
            this.featureUpdateClandestino = features[0];


update: function(){
   var featLyrClandestino = new esri.layers.FeatureLayer(this.URL_Clandestino_Feature);

   //change attribute value
   this.featureUpdateClandestino.attributes.ECONOMIAS = 100;

   var applyDeferred = featLyrClandestino.applyEdits(null, [this.featureUpdateClandestino], null);
      function (result) {
   ),lang.hitch(this, function(err) {
      console.error("Error: ", err.message);


Warley Rocha Mendes

Tags (2)
0 Kudos
1 Reply
New Contributor

Hi WarleyMendes,

I am also face such kind of problem in our project. If you get throughout this problem. Please suggest me some solution. What is a the root cause of this problem? and how it get fixed?

0 Kudos