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