TransWikia.com

Enforce that all "Enforce expression constraints" of child tables are valid before I can save the parent feature

Geographic Information Systems Asked by user191847 on March 11, 2021

In QGIS 3.16 I set up a relation between two tables.

In the child-table I set a constraint-expression and checked "Enforce expression constraints".

If I add one or more features to the child-table which have attributes, which are not valid, QGIS recognizes them as "invalid" as expected but:

  1. I can still toggle editing mode for child layer – although some data in child-layer is "invalid"
  2. I can still save the parent-layer ("OK"-Button is not disabled) – although some data in child-layer is "invalid"

How can I prevent the user from saving invalid data in both cases without python-scripts (like How can i prevent a form from closing unless data is accepted by validation) ?
(I thought to set up a constraint-expression and "Enforce expression constraints" in the parent-table, which checks all child-feature data – but there seem not to be a way to do this.)

I’d like not to use Python because:

  1. I have a parent-/child-relation (which is -as far as I know – very complicated to realize with custom forms) and
  2. I’d like to use this project in QFIELD, which has – as far as I know – limitations with custom-forms – so I use drag and drop-forms

enter image description here

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP