<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Franklin Gothic Book";
        panose-1:2 11 5 3 2 1 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-postmall17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><a name="T_Default_New">Hi list!<o:p></o:p></a></p>
<p class="MsoNormal">I have a project with tree tabels stored in PostGIS. <span lang="EN-US">
One is holding the geometry the other two is holding data related to the first table as child and grandchild. I have set up foreign keys between the tables in the database to be sure that there will be no orphan records. In QGIS there are relations and (sub)forms.
 When I digitize a new geometry I get the new id from the database (before it’s saved, OK) in the form but I can’t add any children. I get a database error that says that there are no parent with that ID (and that’s true). I have to  press OK to create the
 feature in QGIS, change tool to identify, find the feature and klick on it to open the form again. Then I can add children. But I haven’t saved so there is still no parent. But it works then. It’s the same with the grandchild table but then the grandparent
 form is still open so it’s not such a big problem. Anyone got a better way to skip this closing and reopening of the form in the workflow?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:black;mso-fareast-language:SV">Karl-Magnus Jönsson</span></b><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:black;mso-fareast-language:SV">
 | Gis-Utvecklare<br>
Geografisk information<br>
Miljö- och samhällsbyggnadsförvaltningen<br>
Kristianstads kommun<br>
Besöksadress: Västra Storgatan 12<br>
Postadress: 291 80 KRISTIANSTAD<br>
Telefon: 044-135416 | Mobil: 0733-135416<br>
E-post: </span><a href="mailto:Karl-Magnus.Jonsson@kristianstad.se"><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:blue;mso-fareast-language:SV">Karl-Magnus.Jonsson@kristianstad.se</span></a><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:black;mso-fareast-language:SV">
<br>
</span><a href="http://www.kristianstad.se/"><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:blue;mso-fareast-language:SV">www.kristianstad.se</span></a><span style="mso-fareast-language:SV"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:SV"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:black;mso-fareast-language:SV">Läs mer om hur vi hanterar dina personuppgifter på
</span><a href="http://www.kristianstad.se/personuppgifter"><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:blue;mso-fareast-language:SV">www.kristianstad.se/personuppgifter</span></a><span style="font-size:10.0pt;font-family:"Franklin Gothic Book","sans-serif";color:black;mso-fareast-language:SV"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>