AnsweredAssumed Answered

QueryTask outStatistics

Question asked by vikrant327 on Aug 7, 2015

I need to run a query to get max value of field "IssueID", and then increment this value to add new feature to the layer.

var statisticDefinition = new esri.tasks.StatisticDefinition();
  statisticDefinition.statisticType = "max";
  statisticDefinition.onStatisticField = "IssueID";
  statisticDefinition.outStatisticFieldName = "NewIssueID";
    var query = new esri.tasks.Query();
  query.outFields = ['*'];
  query.where = "1 = 1";
  query.outStatistics = [statisticDefinition];

  var queryTask = new esri.tasks.QueryTask(url);


When initially , there are zero features in the layer, the query is getting error out.