When I query a related (non-spatial) table in an offline geodatabase the relatedResults object is not what I would expect. Can somebody help me understand what I'm doing wrong in the below code? Or perhaps post a code sample of how to query related records in an offline geodatabase? Thank you!
Here is what I'm doing:
//a runtime geodatabase with a points layer an a related table
// set up the query parameters. I know that related records exist for a point feature with ObjectID = 2, I verified by converting the runtime gdb to file geodatabase with ArcMap
// then I execute queryRelated
// then onQueryRelatedStatusChanged I access the relatedResults
geodatabase: gdb2.valid ? gdb2 : null
console.log(queryRelatedStatus) // returns '1' (QueryRelatedStatusInProgress) , then '2' (QueryRelatedStatusCompleted)
console.log(relatedResults) // this returns '[object Object]'
console.log(relatedResults.json) // this returns 'undefined'
There is a Query Related Records sample in AppStudio for a feature service, but it should point you in the right direction
To use the samples in AppStudio, double-click on New App, select the Samples category and scroll down until you find the Query Related Records sample project.
Enter a project title and click OK.
Now open your new project in Qt Creator to look at the source code
Hope this helps,
Thank you for your reply Hannah. I studied that sample. I was unable to get it to work with data stored in a .geodatabase file. Is this perhaps a bug?