Casey,That does sound like an effective approach. As long as the user has a way of providing the data required to create a new record, you'd be set.My app displays the related records in a DataGrid, and if users want to create new related records, they simply click an "Add" button. Then, the fun starts:1) I create a new Graphic instance.2) I manually set one of its attribute values, the foreign key, to the primary key of the record it's related to. (This is how you wire up the relationship back to the record that exists on the "left hand side" of your 1:M relationship.)3) I add the graphic instance to my "related records" FeatureLayer. Voila! You can start adding and modifying the graphic's attributes just like preexisting records.As the user supplies attribute values for the new record, just make sure the attribute names match those in the database itself. Say your FeatureLayer has an attribute called "NAME". Your new graphic instance won't have a "NAME" attribute yet, but you can add one, and when you save your FeatureLayer's edits, that new value will flow back to the database. However, if you tried to add an attribute called something else, like "SNAZZY_NEW_ATTRIBUTE" to your new graphic instance - an attribute that doesn't exist in your database - you'll run into problems. When you save the FeatureLayer's edits, the call will bomb, since there isn't a "SNAZZY_NEW_ATTRIBUTE" field in your database.I hope this helps!Have a good one,Brooks
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.