AnsweredAssumed Answered

applyEdits JavaScript API

Question asked by QP on Feb 5, 2015
Latest reply on Jun 8, 2015 by MKellyesri-ireland-ie-esridist

applyEdits on a polyline FeatureLayer is throwing the error message "Invalid or missing input parameters". The relevant code is given below for reference:

 

function requestCreateFeature() {       

   //loop through the items and add to the feature layer       

   var feature = [];       

   var attr = {};

   var d = new Date();

var geometry;

   if (featType =="point") {

    var myx = pxmin.value;  // value from a user input texbox

    var myy = pymin.value; // value from a user input textbox

    geometry = new Point(myx,myy,map.spatialReference);

   } else {

    var myxmin = lxmin.value;  // values from a user inputtexbox

    var myymin = lymin.value;  // value from a user inputtexbox

    var myxmax = lxmax.value;  // value from a user input texbox

    var myymax = lymax.value;  // value from a user input texbox

    geometry = new Polyline ([[myxmin, myymin],[myxmax, myymax]]);

   }

   attr["sapname"] = pname;      // value from a user input texbox    

   attr["creation_date"] = d.toUTCString();

   attr["status"] = 1;

   var graphic = new Graphic(geometry);         

   graphic.setAttributes(attr);         

   feature.push(graphic);             

   myFeature.applyEdits(feature, null, null, onsucess, onerror);

  }

function onsucess(evt) {

   alert("Edit successful...");

  }

 

  function onerror(evt){

   alert("There is some error in creation...");

  }

Outcomes