Robert,
That worked like a charm! Thank you. I expanded a little bit on it and am now getting the related records as a response after selectedFeature changes:
The code I used (might not be pretty, but it works):
watchUtils.when(view.popup, "selectedFeature", function(evt){
console.log(view.popup.selectedFeature);
var url = view.popup.selectedFeature.layer.url;
var layerId = view.popup.selectedFeature.layer.layerId;
var fullURL = url + "/" + layerId;
var objectID = view.popup.selectedFeature.attributes.OBJECTID;
var queryTask = new QueryTask({
url: fullURL
});
relationQuery = new RelationshipQuery({
objectIds: [objectID],
outFields: ["*"],
relationshipId: 0
});
queryTask.executeRelationshipQuery(relationQuery).then(function(results){
console.log(results)
});
});
Now what I've got to do is append this to the content property of the popup.
I'll keep this thread updated.