I have a feature class and related table both have relation ship, but when i retrieve data from related table i get RelationshipQuery.js:5 Uncaught TypeError: c.join is not a function

1265
2
Jump to solution
01-26-2017 11:53 AM
DayanidhiKhanda
New Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

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 

View solution in original post

2 Replies
UndralBatsukh
Esri Regular Contributor

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 

DayanidhiKhanda
New Contributor

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...

0 Kudos