djain-esristaff

Not able to query related record

Discussion created by djain-esristaff on Sep 2, 2013
Latest reply on Sep 3, 2013 by zj_zou
Dear All

I want to query related record of a feature during identify using ArcGIS Javascript API 3.5
This is how I am working on it:
var relatedQuery = new esri.tasks.RelationshipQuery();
          relatedQuery.outFields = ["*"];
          relatedQuery.relationshipId = 1;
          relatedQuery.objectIds  = 2102;
        var layerinfo = baseLayer.layerInfos;
       
    //   map.layerIds
        var layer = layerinfo[4];
        
            layer.queryRelatedFeatures(relatedQuery, function(relatedRecords) {
            alert("related");
          

})

but it gives error that "the object doesnot support this property or method". I have multiple mapservices in my map.
Please help!

Thanks
Deepika

Outcomes