I have a (hopefully) easy question about feature relationships, and editing records that participate in a relationship with a feature class.
I notice that the QueryTask exposes an ExecuteRelationshipQueryAsync method. This apparently lets you access records related to a given feature (or set of features). I'm thinking of using this to access records that exist in a simple 1:M relationship: one point feature related to 0 or more records in a Table (not a feature class, specifically).
It seems that the QueryTask.ExecuteRelationshipQueryAsync() method would be the ticket to accessing the related records. That would get me half-way to where I need to be. What I'd really like to do is make edits to those related records - the full suite of CRUD operations.
I don't need to use the FeatureDataForm / Grid / etc to pull this off, necessarily - it's quite likely that I'll roll my own custom UI to do this. That would give me the ability to do some legwork under the hood to commit the edits, if I had to. Since the result of the ExecuteRelationshipQueryAsync operation, at the end of the day, is a RelationshipResult instance, I can get at the related records (as Graphics), and could easily make changes to their attributes.
It's the next step that I can't quite figure out. Once I've made my changes, I have to be able to save my edits. In addition, I'll have to be able to add and remove related records. To do that, I suppose that I'll need a feature layer; one that represents the table containing my related records. I can put that together, of course, without much trouble.
The question then, is this: will my edits be committed if I, say, change the attributes of a Graphic in the RelationshipResult.RelatedRecordsGroup and then call SaveEdits() on the feature layer that represents the related table? Or do I need to do something like inspect the Graphics in the RelationshipResult.RelatedRecordsGroup, and then go retrieve them again from my feature layer, and modify those instances' attributes, in order for SaveEdits() to work?
Perhaps what I'm trying to accomplish isn't possible. If that's the case, I have some alternate workarounds that I can explore. It would be cool, though, if I could use the existing API to accomplish this task.
Thanks!
Brooks