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:
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?).
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:
The parent table is here:
And the related table here (parent's globalids match):
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.
Solved! Go to Solution.
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.
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.
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!