1 Reply Latest reply on Apr 14, 2012 8:01 AM by geodan7

    applyEdits works for new/delete, but not update?

      Hi All,

      I'm working on a custom application that doesn't use the AttributeInspector/TemplatePicker...because I had to get greater control over things. Anyway, in a simple example I had worked up, I was able to applyEdits (new, updates, and deletes)...so i thought everything was ok. Then, I went further, creating a slightly more complex application...and somewhere along the way...my "updates" (when calling applyEdits) fails...the feature just reverts back to whatever it was...although the onEditsComplete event is raised, I'm not able to get the FeatureEditResult object back for updates...the event simply returns "null". I am STILL able to create and save new features, as well as select and delete features.

      Anyone have any ideas why applying update edits would fail? It works in a simpler page I have (although i'm using the attribute inspector there). It's not a data permissions issue because that simple page can appy all 3 types of edits. Why would the FeatureEditResult for updates return NULL???

      thanks, I'm stuck!
        • Re: applyEdits works for new/delete, but not update?
          Yeah, so, I was a dum dum last night :)

          The issue was that when I used the setAttributes method to update the attributes of my feature (based on what was in my own attributes window), ...it was clearing the objectID, because I don't have a visible control showing the user the objectID...when I went through the loop of my attributes...it only set the values I specify...effectively clearing out existing attributes...maybe there should be an 'updateAttributes' method...but that's nit-picky i guess.