POST
|
Using the executeRelationShipQuery on a queryTask an object with the related record groups is returned. The OIDs can be used as a key to then get to the object Ids (or whatever is needed) within the related record groups. This is how I did it: var queryTask = new QueryTask("http//...");
var query = new RelationshipQuery();
query.outfields ;
query.objectids [queryIds]; // multiple Ids e.g. [105,106,233]
query.relationshipId = 2;
queryTask.executeRelationshipQuery(query, function(realtedRecordsGroups)){
allRelatedRecordsIds = [];
for(var obid in relatedRecordsGroups){
allRelatedRecordsGroups.push(results.features.attributes.OBJECTID);
}
});
... View more
03-12-2018
12:39 AM
|
1
|
0
|
773
|
POST
|
Robert, Sure, I can query for multiple but I need an example how I can actually access the result. I am able to get the keys but not the actual related record group records. So I was hoping to see if it is done somewhere to get a better understanding.
... View more
03-07-2018
09:28 AM
|
0
|
1
|
773
|
POST
|
Thanks Robert for taking a look at it. I'm actually using executeRelationshipQuery on a queryTask but even then is the example really feeding multiple ObjectIDs into the query? I'm looking at line 151: relatedQuery.objectIds = [graphicAttributes.objectid];
... View more
03-07-2018
02:32 AM
|
0
|
3
|
773
|
POST
|
I am making a relationship query with multiple Objects IDs and receiving multiple related record groups. I can access the Object IDs for the related records but I don't know how to access the actual records for that ID. Is there an example on how to access related record groups and its records?
... View more
03-06-2018
03:21 AM
|
0
|
6
|
1279
|
POST
|
Thanks. I just realised my mistake was somewhere else but the executeforids option is much nicer so I changed it to that.
... View more
02-27-2018
02:41 PM
|
0
|
1
|
871
|
POST
|
I'm trying to make a relationship query with the returned object ids from a previous query but having trouble passing multiple IDs var query = new Query();
query.returnGeometry = false;
query.outFields = ["OBJECTID"];
query.where = requestTerm;
myQueryTask.execute(query, function(results) {
if (results.features.length > 0) {
var ids = [];
for (var i = 0; i < results.features.length; i++){
ids(Number(results.features[i].attributes.OBJECTID));
}
query = new RelationshipQuery();
query.returnGeometry = false;
query.outFields = ["OBJECTID"];
query.objectIds = [ids];
query.relationshipId = 1;
myQueryTask.executeRelationshipQuery(query, function(set) {
// ....
}
}
} I also tried to set the IDs with ids(new Number(results.features[i].attributes.OBJECTID)); as well as directly, but nothing seems to work. query.objectIds = [304,305,306];
// and casted
query.objectIds = [Number(304),Number(305)]; but nothing seems to right. Any suggestions or is there an example with multiple ObjectIds?
... View more
02-27-2018
01:09 PM
|
0
|
3
|
1324
|
Title | Kudos | Posted |
---|---|---|
1 | 03-12-2018 12:39 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|