Related form not updated

Hi Guys,

I’m not sure if I found a bug or just don’t understand how relations are supposed to work.
There is a sample solution attached. In it, there are two tables linked in a one-to-many relation.
If I base my main form on the main table and have a tab on it going to another form with the related foundset (the other table) and then yet another tab going to yet another form with the same child table foundset, then the child records aren’t refreshed as the main form record index changes.
However, if I base my main form on the parent table and all subsequent forms are based on it except the deepest destination form, then it’s all fine.

Could anyone explain why it works like that? (sample solution attached)

Cheers,
Maria

testRelations.servoy (32.3 KB)

Hi Maria.

I have also seen that behaviour and I guess it is not a bug. What I understand from that is that a related foundset is a small piece of a table that belongs to the one that is related and is refreshed only when the main table changes and if you create a new form based on the related table there is no filter of records. Remember that when you place a tabpanel on a form you have to specify the relation and during the creation of a form there is no relation involved.

What I use to do is create that form, not the one in the tabpanel, based on the main table and not as separated foundset so it keeps track of the records and the fields to be shown are based on the fields in the relation.

I hope I have explained my self and if any Servoy guy can confirm or add information abiut woukd be great.

Cheers.

Maria,

Your main form (form1) and form2 are on the same table and do not have namedFoundSet=separate, so they share the foundset.
Then when you place a related tabpanel (like form3 on form2) it will listen to the selection of the main foundset and adjust accordingly.

The right tab does not listen because the first step it is linked via the relation, but not from form4 to form5.
Form5 will simply show a foundset on keys.

Hope this helps,

Rob

rgansevles:
Maria,

Your main form (form1) and form2 are on the same table and do not have namedFoundSet=separate, so they share the foundset.
Then when you place a related tabpanel (like form3 on form2) it will listen to the selection of the main foundset and adjust accordingly.

The right tab does not listen because the first step it is linked via the relation, but not from form4 to form5.
Form5 will simply show a foundset on keys.

Hope this helps,

Rob

Oh… Ok, I get it now :D
Form4 and form5 have the same dataSource but their foundsets are filtered differently because one is based on the relation and the other isn’t.
Too much work and no play… :lol: Thanks guys.

Cheers,
Maria