Select to view content in your preferred language

queryTask Error: Unable to complete operation.

10050
3
Jump to solution
06-10-2012 09:19 PM
MatejSkerjanc
Regular Contributor
Hello guys i'm running a query task. Upon execution i'm running into the message: Error: Unable to complete operation.
Made this widget like few before. But this time my service call looks like this:
dojo.io.script.jsonp_dojoIoScript5._jsonpCallback({"error":{"code":400,"message":"Unable to complete  operation.","details":["'where' parameter not specified","'objectIds' parameter not specified","'time' parameter not specified","'geometry' parameter not specified","'text' parameter not specified","Unable to complete Query operation."]}});

contrasting the one i get from a working example:
dojo.io.script.jsonp_dojoIoScript12._jsonpCallback({"displayFieldName":"IME_ZNAMEN","fieldAliases":{"STATUS":"status","IME_ZNAMEN":"ime znamenitosti","POVRSINAHA":"površina v ha"},"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":102060},"fields":[{"name":"STATUS","type":"esriFieldTypeString","alias":"status","length":127},{"name":"IME_ZNAMEN","type":"esriFieldTypeString","alias":"ime znamenitosti","length":127},{"name":"POVRSINAHA","type":"esriFieldTypeDouble","alias":"površina v ha"}],"features":[{"attributes":{"STATUS":"naravni spomenik","IME_ZNAMEN":"Kamnica - Vra?je skale - površinsko geomorfološki naravni spomenik","POVRSINAHA":5.7971167100000001},"geometry":{"rings":[[[546636.05630000029,158997.63260000013],................loads of data...........]]]}}]});

Now my code looks like this:
var queryTask = new esri.tasks.QueryTask(HoverLinkWidget_config.layerUrl+"/0");
   var query = new esri.tasks.Query();
   //query.outSpatialReference = map.spatialReference.wkid;
   query.returnGeometry = true;
query.outFields = ["*"];
queryTask.execute(query, HoverResults, HoverError);


So upon executing this i get to HoverError function which reports the error.

Is there something awfully apparent i'm doing wrong here?

Thanks guys
0 Kudos
1 Solution

Accepted Solutions
HemingZhu
Frequent Contributor
It seems the issue is missing where statement query.where but as i read its not mandatory. Anyone care to enlightening me about this please.


thank you


Either specify a spatial filter or attribute filter (even through you want to retrieve all the records - use something like query.where ="1=1").

View solution in original post

0 Kudos
3 Replies
MatejSkerjanc
Regular Contributor
It seems the issue is missing where statement query.where but as i read its not mandatory. Anyone care to enlightening me about this please.


thank you
0 Kudos
HemingZhu
Frequent Contributor
It seems the issue is missing where statement query.where but as i read its not mandatory. Anyone care to enlightening me about this please.


thank you


Either specify a spatial filter or attribute filter (even through you want to retrieve all the records - use something like query.where ="1=1").
0 Kudos
MatejSkerjanc
Regular Contributor
oh so it is mandatory in some way. Yep i used 1=1 to get them all:)

Thanks
0 Kudos