Select to view content in your preferred language

QueryRelatedAsync doesn't return rows but it should

4117
2
Jump to solution
02-03-2015 01:06 AM
JuhoVainio
Deactivated User

I have created an offline replica from our enterprise geodatabase. The replica contains several tables and it's created successfully. However, when I try to query related data between two tables, I get zero results even though the tables have rows that should be returned.

I have the code here that gets the relationshipID and does the query:

related1.png

Here are the relationship details. One question is, how does the offline database know what relationshipID is the correct one (in this case, 23)? I haven't been able to find it in the GDB_-tables (GDB_RelationshipItems?).

related2.png

As you can see, the table correcly shows that there are TWO rows to be returned with this relationshipQuery. Also the globalIds are the same, the parent's ObjectId matches and the SQLite Browser shows the data correctly:

related3.png

The parent table is here:

related4.png

And the related table here (parent's globalids match):

related5.png

So the questions is, why doesn't the QueryRelatedAsync return any data even when the data is in the database correctly? What else can I try to test if, for example, some relationships aren't synched correctly to the replica?

Edit: I need to add that the geometry layers from the gdb are shown on the map correctly, but the plain tables just don't return any data.

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

It looks like you're calling QueryRelatedAsync on the related table and not on the source table, is that correct? You don't need the related table to get the related records. The operation is performed on the main table.

Also make sure the related table and the related rows are included when you generate the local geodatabase.

View solution in original post

2 Replies
dotMorten_esri
Esri Notable Contributor

It looks like you're calling QueryRelatedAsync on the related table and not on the source table, is that correct? You don't need the related table to get the related records. The operation is performed on the main table.

Also make sure the related table and the related rows are included when you generate the local geodatabase.

JuhoVainio
Deactivated User

Yeah, such a small thing but yet I didn't see it. It's always good to have someone else to look your code as it's easier for an outsider to spot errors Thanks!

0 Kudos