0

Determining if children exist

In various places I have used the construct:-

if 'children table ref field' then do something end

In fact I sometimes hide an empty reference field to the child table by putting the reference field name in the 'display only if' so the field is only displayed if it contains a record, or indeed, sometimes to display or not depending on children in a different table.

Has always seemed to work as an empty field effectively returns false. However…

Today I had occasion to see child records not supposed to be there. The field was of course displayed as it was not empty. I switched to the appropriate table to remove the children (actually just to unlink from the parent), but in the parent record window, the child reference field was still displayed, yet clearly empty. So it should now be hidden.

I switched to other tables and returned, but still the same problem. I closed the db and re-opened it (did not quit Ninox) and now that empty reference field is correctly hidden. So whatever the rights and wrongs of doing it this way, Ninox should NOT display/behave differently just by closing and re-opening a db. I would consider this a bug.

The use of a field like that to determine whether empty or not, should either work or not. If not, then have to count() children to determine if there actually are any, but it does work until the children are 'unlinked' from the parent and then Ninox erroneously thinks they are still there, even while clearly displaying they are not.

So, usual question. Anyone else seeing this?

Reply

null

Content aside

  • 1 yr agoLast active
  • 22Views
  • 1 Following