How to find related records using a Dynamic layer

494
4
09-26-2011 08:57 PM
StephenLead
Regular Contributor III
The sample here shows how to find related records when working with a Feature layer, using queryRelatedFeatures.

Is it possible to find related records when using a Dynamic layer?

Ideally I'd want to hook this up to an Identify task, or a QueryTask, both of which would run when clicking on the map.

Thanks,
Steve
0 Kudos
4 Replies
derekswingley1
Frequent Contributor
Yes, I believe you could do this but why not just go with the feature layer approach shown in the sample? If you use selection mode, as the sample does (against a dynamic map service), it's doesn't bring features to the client until you ask for them (via a click to search).
0 Kudos
StephenLead
Regular Contributor III
good idea, I'll give it a go.

Thanks,
Steve
0 Kudos
StevenGriffith
New Contributor III
I've got a Dynamic Map layer that has related records - so how do I do a query for related records for this layer? Loading this service as a Feature layer is not an option at this time.

Steve G.
0 Kudos
derekswingley1
Frequent Contributor
Just curious...why isn't a feature layer an option?

If you don't want to use a feature layer, use a queryTask.executeForIds against your layer to get a list of object IDs then use those with queryTask.executeRelationshipQuery.
0 Kudos