<div dir="ltr"><div>Hi,</div><div><br></div><div>it's probably me not being a power user, but from a few simple tests I'm doing with relations (1:n) on spatialite/gpkg layers I'm experiencing a few issues and I wonder if there is something I missed or if we can improve the workflow.</div><div><br></div><div>My test schema is pretty simple:</div><div>-----------</div><div>table1 (parent)<br></div><div>-----------<br></div><div>fid (default: sqlite_fetch_and_increment...)</div><div>name</div><div><br></div><div><div>-----------</div><div>table2 (child)<br></div><div>-----------<br></div><div>fid</div><div>fk_table1 -> table1.fid<br></div><div>name</div><div><br></div></div><div>ISSUE 1:</div><div>- add a new item in table1</div><div>- in the embedded form add a table2 item</div><div>- click on "Save child layer edits" button -> backend CONSTRAINT FAILURE! because table1 parent is not saved (and not even in the editing buffer, for what matters)</div><div><br></div><div>QUESTIONS on ISSUE1:</div><div>- should we disable the "Save child layer edits" button in case the parent is unsaved?</div><div>- what's the idea behind the "Save child layer edits" when the user cannot even save the parent from the form, why can she save the children?</div><div>- would it make sense to check for the unsaved parent in QgsRelationEditorWidget::saveEdits() before attempting a children save?</div><br><div>ISSUE 2:</div><div>- preparation: add one parent and a few children and commit</div><div>- activate identify tool and click on a parent feature<br></div><div>- the form opens but no children are shown in the child form, all values are NULL, I would expect that the first child is automatically selected and focused<br></div><div><br></div><div>ISSUE 3:</div><div><div>- preparation: add one parent and a few children and commit</div><div>- activate identify tool and click on a parent feature<br></div></div><div>- click on "Add Point child feature"</div><div>- click on map canvas</div><div>- another attribute form opens, I would expect that instead of opening a new form, the embedded form was focused, with the new feature geometry associated and ready for input of other field values, the form open may be fixed with the option I've added here:  <a href="https://github.com/qgis/QGIS/pull/34654">https://github.com/qgis/QGIS/pull/34654</a>.</div><div><br></div><div>Before I attempt any further patches, I'd like to hear your opinion on how we could make the data entry process a little bit easier and error-proof in case of parent-child relations, especially now that QGIS is dropping the GIS and becoming the new Access ;)<br></div><div><br></div><div></div><div>Cheers</div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Alessandro Pasotti<br>w3:   <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div></div>