Hi all!
Just discovered a peculiar thing with relations and forms. If it is a bug it is 
strange no one have reported it before. Or it is just me not knowing how to use 
it properly. Anyway.

I have two tables from PostgreSQL with foreign keys and a 1:N relation set up 
in QGIS. In the child table I have NOT NULL constraint on a field (other than 
the foreign key) in the database.
I set up automatic transaction groups and it works well adding child features 
and add values to the not null field.
When I check the "Force hide form on add feature" option for the child 
relation, in the Layer properties, Attributes form, Drag and drop designer, 
Relations options, I get an error from the database since I have no default 
value for the NOT NULL constraint field.
OK. That's maybe make sense. I can remove the constraint or remove automatic 
transaction groups and it works. A default would also work but I can't set a 
correct value. Depends on other things. But I'd rather show the standalone form 
for the new child feature again.
But I can't undo this option and make it work. Still doesn't open a standalone 
form. Seems that the option becomes global in some way. It works in a fresh 
install or profile. But not a new project.

Does someone knows where this option can be unset? Unsetting it in the UI 
doesn't work. QGIS 3.22.3 on Windows.
But the same since 3.16 at least.

Best regards

Karl-Magnus Jönsson


_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to