Hi,
I am using arcgis javascript 4.1 api.I have a feature class and related table both have relation ship, but when i retrieve data from related table i got
the following error
RelationshipQuery.js:5 Uncaught TypeError: c.join is not a function
at Object.toJSON (RelationshipQuery.js:5)
at Object.executeRelationshipQuery (init.js:2096)
at showRestaurant (Bestaurant11.html:244)
at HTMLAnchorElement.onclick (VM2846 Bestaurant11.html:1)
Here is some portion of the code
var relatedReviews =new RelationshipQuery();
relatedReviews.outFields=["*"];
relatedReviews.relationshipId =0;
relatedReviews.objectIds=feature.attributes.OBJECTID;
queryTask.executeRelationshipQuery(relatedReviews).then(function(relatedRecord){
...................
});
please help me how can i solve it?
Solved! Go to Solution.
Hi there,
Looking at your code... I think this line has the issue:
relatedReviews.objectIds=feature.attributes.OBJECTID;
RelationshipQuery.objectIds expects an array of numbers: RelationshipQuery | API Reference | ArcGIS API for JavaScript 4.2
So please try changing the line to:
relatedReviews.objectIds = [feature.attributes.OBJECTID];
here is a very simple sample that works: JS Bin - Collaborative JavaScript Debugging
Hi there,
Looking at your code... I think this line has the issue:
relatedReviews.objectIds=feature.attributes.OBJECTID;
RelationshipQuery.objectIds expects an array of numbers: RelationshipQuery | API Reference | ArcGIS API for JavaScript 4.2
So please try changing the line to:
relatedReviews.objectIds = [feature.attributes.OBJECTID];
here is a very simple sample that works: JS Bin - Collaborative JavaScript Debugging
Hi Sir,
thanks for give me time. and for small mistake i spend a lot time for this.
and i correct my code as per you mentioned above
and it Works .
thank you very much...