AnsweredAssumed Answered

applyEdits not sending all attributes

Question asked by brysageek on Sep 12, 2017

attempting to to simple update on feature: something like this..

 

String finalFireNumber = "000-000-000-000"

 

var relatedPerimeters  = await ((ArcGISFeatureTable)MapHelper.IncidentsPointFeatureLayer.FeatureTable)
.QueryRelatedAsync(Convert.ToInt32(_selectedIncidentFeature.Attributes["OBJECTID"]), 0);

 

if (relatedIncidentPerimeters != null && relatedIncidentPerimeters.Count > 0)
{
   foreach (var perimeter in relatedIncidentPerimeters)
   {
      perimeter.Geometry = GeometryEngine.Project(perimeter.Geometry, new SpatialReference(102100));
      perimeter.Attributes["IncidentNumber"] = finalFireNumber;

      await MapHelper.IncidentsFirePerimetersFeatureLayer.FeatureTable.UpdateAsync(perimeter);
      incidentsInstance.SelectedIncidentPerimeter = perimeter;
}

var perimeterUpdates =
   await ((ServiceFeatureTable) MapHelper.IncidentsFirePerimetersFeatureLayer.FeatureTable)
   .ApplyEditsAsync();
}

 

When I look at the post to the service in transit I see that it is leaving the IncidentNumber out -- ? why is that?

 

 

here is the json of the feature I am trying to update on the applyeditsasync()

 

[{"geometry":{"rings":[[[-13534818.254799999,5268747.6445999965],[-13536141.173999999,5269726.6048000008],[-13535426.797600001,5271314.1077999994],[-13532595.750500001,5271578.6916999966],[-13532225.3332,5270414.5227999985],[-13533601.1691,5268456.6023999974],[-13534818.254799999,5268747.6445999965]]],"spatialReference":{"wkid":102100,"latestWkid":3857}},"attributes":{"OBJECTID":8407,"PerimeterTime":1504908700000}}]

 

I am not sure as to why the attributes would be getting left out, I can also see that after the updateAsync call that my feature does get updated and the hasEdits property is set to true.  Looking at server logs there are not any errors and the values does exceed length and is the proper type.

 

Using the WPF Runtime 10.2.7

 

 

**** UPDATE ****

so adding 

  ((ServiceFeatureTable)MapHelper.IncidentsFirePerimetersFeatureLayer.FeatureTable).OutFields = new OutFields(new [] {"*"});

 

and casting all calls to MapHelper.IncidentsFirePerimetersFeatureLayer.FeatureTable as ServiceFeatureTable seems to be the fix

Outcomes