I am attempting to applyEdits of a record for a related table that is being updated. My steps are to first set the attributes using record.setAttributes(attributes); I've included all the attributes (including the ObjectID). I then run applyEdits on the proper feature layer. Most of the time it works. Occasionally, however, I receive the following error: "Cannot read property 'attributes' of undefined". I've noticed that even though I receive this error message, the update still works. And as I mentioned above, this doesn't occur every time. Thoughts on why I'm getting this, and how to adjust my code so that this never occurs?
Thanks Thejus:
For the case where I insert new table records, every once in a while, I do get an 'undefined' attribute which is sending the same error message. Since it only happens like 2% of the time, it's hard to put my finger on the problem. I'm guessing a problem with my asynchronous calls. I'll look at this some more regarding my update attributes as well. Thanks.