Select to view content in your preferred language

Show related records for all selected features

3026
0
06-28-2013 05:56 PM
CaseySchneebeck
Occasional Contributor
I'm having trouble extending the Multiple Related Records sample. I want to get related records from all selected features, not just the first one as the sample provides.

First I made a loop to captures all the object ids of the features selected...

var features:Array = event.features;
var ids:Array = [];
var i:int = 0
for each (var f:Object in features){
ids.push(features.attributes.OBJECTID);
i = i + 1;
}
relatedTopsQuery.objectIds = ids;

Then I call queryRelatedFeatures. This returns a relatedRecords object and the sample pulls out the related records for the first feature as shown...

var fset:FeatureSet = (relatedRecords[event.features[0].attributes.OBJECTID]);
if (fset is FeatureSet){
resultArray = [];
resultArray = fset.attributes;
showIden();
}

I want to get the related records for all features, not just the first one. I thought I could use similar logic for getting the object ids, but can't seem to make it work. Any suggestions are appreciated.

Cheers,
Casey
Tags (2)
0 Kudos
0 Replies