nonpoint1989

Feature Service Error related to javascript api

Discussion created by nonpoint1989 on Jan 31, 2013
Latest reply on Apr 2, 2013 by samirgambhir
While trying to add a feature service widget that is partly based off of
[HTML]http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/ed_default_editingwidget[/HTML]
and partly based off of an existing page. While the feature layers do appear in the toolbar/content pane. I currently am getting an error when I try to do the doubleclick that sends the information to the server

I beleive this results from incorrect input parameters being sent due to this page:
[HTML]http://resources.arcgis.com/en/help/main/10.1/index.html#/Task_operation_execute_REST/0057000000m5000000/[/HTML]

The form data sends is :
f:json
adds:[{"geometry":{"rings":[[[-9163974.606536975,4639277.6829617545],[-9156961.509191819,4634863.444578291],[-9166363.263670884,4627678.363919495],[-9166879.213611808,4640099.381015819],[-9163974.606536975,4639277.6829617545]]],"spatialReference":{"wkid":102100}},"attributes":{"PROBKEY":"SP","COMMENTS":null,"PADNUMBER":null,"PADNAME":null,"AREA_":null,"DEPTH":null,"VOLUME":null,"STATUS":null,"UPDATEDBY":null,"DATEUPDATED":null}}]

Here is the code which may be responsible for the error:
 function initEditor(results) {
 var templateLayers = dojo.map(results,function(result){
          return result.layer;
        });
 
 var templatePicker = new esri.dijit.editing.TemplatePicker({featureLayers: templateLayers,     
                rows: "auto",
                columns: 3
                },'editingDiv');
 templatePicker.startup();
var layerInfos = dojo.map(results, function(result) {
          return {'featureLayer':result.layer};
        });
        


        var settings = {
          map: map,
          geometryService: new esri.tasks.GeometryService("/arcgis/rest/services/Utilities/Geometry/GeometryServer"),
    templatePicker: templatePicker,
    layerInfos: layerInfos,
    
        };
        var params = {
          settings: settings
        };
        editorWidget = new esri.dijit.editing.Editor(params);
        
        var options = {snapKey:dojo.keys.copyKey};
        map.enableSnapping(options);
        
        editorWidget.startup();
      }


The error is below.
Error {code: 400, message: "Unable to complete operation.", details: Array[0], log: undefined}
_ssl: undefined
arguments: undefined
code: 400
details: Array[0]
get stack: function () { [native code] }
log: undefined
message: "Unable to complete operation."
set stack: function () { [native code] }
type: undefined
__proto__: d
 serverapi.arcgisonline.com:15
_48f serverapi.arcgisonline.com:15
(anonymous function) serverapi.arcgisonline.com:15
_1e1 serverapi.arcgisonline.com:15
_1df serverapi.arcgisonline.com:15
resolve.callback serverapi.arcgisonline.com:15
_1e1 serverapi.arcgisonline.com:15
_1df serverapi.arcgisonline.com:15
resolve.callback serverapi.arcgisonline.com:15
_1e1 serverapi.arcgisonline.com:15
_1df serverapi.arcgisonline.com:15
resolve.callback serverapi.arcgisonline.com:15
_1e1 serverapi.arcgisonline.com:15
_1df serverapi.arcgisonline.com:15
resolve.callback serverapi.arcgisonline.com:15
rDfd.then.otherwise._49d.error serverapi.arcgisonline.com:15
_4b9 serverapi.arcgisonline.com:15
_4b3 serverapi.arcgisonline.com:15
resolve serverapi.arcgisonline.com:15
_4c0 serverapi.arcgisonline.com:15
_4b9 serverapi.arcgisonline.com:15
_4b3 serverapi.arcgisonline.com:15
resolve serverapi.arcgisonline.com:15
_4c0 serverapi.arcgisonline.com:15
_4b9 serverapi.arcgisonline.com:15
_4b3 serverapi.arcgisonline.com:15
resolve serverapi.arcgisonline.com:15
_4c0 serverapi.arcgisonline.com:15
_4b9 serverapi.arcgisonline.com:15
_4b3 serverapi.arcgisonline.com:15
resolve serverapi.arcgisonline.com:15
_3dd serverapi.arcgisonline.com:15
_3e9 serverapi.arcgisonline.com:15

and the code in the init that is related to the init editor
dojo.connect(map, "onLayersAddResult", initEditor);
 var operationsPointLayer = new esri.layers.FeatureLayer("/arcgis/rest/services/app_services/AMLedit/FeatureServer/0", {
  id: "amlPoints",
          mode: esri.layers.FeatureLayer.MODE_SELECTION,
          outFields: ["*"]
    
        });
        var operationsLineLayer = new esri.layers.FeatureLayer("/arcgis/rest/services/app_services/AMLedit/FeatureServer/1", { 
   id: "amlLines",
         mode: esri.layers.FeatureLayer.MODE_SELECTION,
         outFields: ["*"],
   
        });
        var operationsPolygonLayer = new esri.layers.FeatureLayer("/arcgis/rest/services/app_services/AMLedit/FeatureServer/2", {
   id: "amlPolygon",
          mode: esri.layers.FeatureLayer.MODE_SELECTION,
          outFields: ["*"],
    
        });
   var operationsProblemsLayer = new esri.layers.FeatureLayer("/arcgis/rest/services/app_services/AMLedit/FeatureServer/3", {
   id: "amlPolygon",
          mode: esri.layers.FeatureLayer.MODE_SELECTION,
          outFields: ["*"],
    
        });
  map.addLayers([operationsPointLayer, operationsPolygonLayer, operationsLineLayer,operationsProblemsLayer]);

I am pretty confident that something needs to be tweaked in initeditor. I just am not sure what at this point

Outcomes