2

I am experimenting with a new feature available since version 2.2 "Relations" where foreign key relations from a database can be documented, so that the QGIS UI can (auto) generate its attribute editor layout in Master-Detail / Parent-Child forms. We are trying to style a layout for:

  • one Master/Parent Table (Properties [with geomety]) and a number of Detail/Child Tables:
  • Parcels [with geomety]
  • Rights
  • Actions
  • Documents

The relationships between these layers can be defined in Project:Project Properties:Relations. Note that all child layers/tables have a single column foreign key (called "bau_guid"), all refering to the single column primary key (also called "bau_guid").

Project Relations between layers

When we select "Autogenerate" for the Attribute editor layout of the Master Table/Layer Properties, QGIS will automatically generate a UI with information of the Master (Properties) and the detail layers vertical master-detail layout which can be navigated

QGIS Autogenerated Layout

If you want to navigate master-detail-detail relations, space will become an issue in the layout, so you can also revert to Drag-and-Drop Layout, which will create Tab pages for all detail layers.

Drag and Drop Layout

Tab Page Parcels

Tab Page Rights

Tab Page Documents

When a change is made to the layout (even if it concerns an attribute unrelated to relations), there is a problem with the DragAndDrop tabulated layout, an error message "Error: Field does not exist in datasource" appears in the place of the detail layer/relation.

Error Field does not exist in datasource

Only when I remove all "relations" from the drag and drop definition and "drag and drop" them again and "in one go" it seems to work again, until the next time anything changes in the layout.

How can we solve / work around this error?

1

This looks like a bug. Please open a bug erport, consider creating a pull request or funding somebody to implement this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.