Folks
Is this expected to work?
I cannot get it to go.
I am guessing I have to create a new RelationQuery through code.
Let me know.
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Query State Info without Map</title> <script src="http://js.arcgis.com/3.13/"></script> <script> require([ "dojo/dom", "dojo/on", "esri/tasks/query", "esri/tasks/QueryTask", "dojo/domReady!" ], function (dom, on, Query, QueryTask ) { var queryTask = new QueryTask("http://localhost:6080/arcgis/rest/services/Ggov/MI_Default/MapServer/7/queryRelatedRecords"); var query = new Query(); query.returnGeometry = false; query.outFields = ["*"]; query.relationshipId = 0; query.objectIds = [2, 3]; queryTask.execute(query, showResults); function showResults(results) { var resultItems = []; var resultCount = results.features.length; for (var i = 0; i < resultCount; i++) { var featureAttributes = results.features.attributes; for (var attr in featureAttributes) { resultItems.push("<b>" + attr + ":</b> " + featureAttributes[attr] + "<br>"); } resultItems.push("<br>"); } dom.byId("info").innerHTML = resultItems.join(""); } }); </script> </head> <body> <div id="info" style="padding:5px; margin:5px; background-color:#eee;"> </div> </body> </html>
Thanks
Keith Anderson
Solved! Go to Solution.
Keith,
You need to use the RelationshipQuery class and the QueryTasks executeRelationshipQuery method.
Keith,
You need to use the RelationshipQuery class and the QueryTasks executeRelationshipQuery method.
Thanks Robert...Thats what I am working on now..
I take that back... I am using .queryRelatedFeatures.
I will check into .executeRelationshipQuery too.
Thanks Robert