0

1 to N table had values removed

Hello again - I had a problem the other day on the macOS desktop client where I was not able to access my databases.  suggested i delete the preferences via the terminal, which worked, and access returned. 

Today I was trying to make a change to my database and I noticed I was unable to edit. After searching the forums a suggestion of "reorganizing the data" would fix things, which it did.

After both of these, I went in to use my database as intended and noticed that a table populated by a table with a dynamic choice had all its values stripped. Sometime it shows a random number, other times it shows a completely invalid choice, other times it shows nothing. 

The backup I made before the reorganization is showing the same thing.  What happened here? Is there any way to fix this without manually working my way back through 250 some odd records, each with a dozen or more entries? 

3 replies

null
    • Fred
    • 5 days ago
    • Reported - view

    Sadly you have encountered the main issue with dynamic fields. I forgot that reorganize not only allows you to edit your DBs on another device, but it tells Ninox to do sort of reset record Ids. That is why I do not use dynamic fields as storage but only as a UI element. All of my dynamic field selections are written to a table. I've only seen this happen with dynamic fields that come from tables where you only grab a subset of records that change constantly. And only when you delete groups of records from the root table.

    This is how I think about this issue. In my DB, I track show jumping results. I track the rails that are knocked down by each rider and horse. So there is a different order of jumps for each event, and some even have two different set of jumps. For event1, records 1 - 10 from the course table are displayed in the dynamic choice for each rider. So then I select from those 10 records. Then event2, records 11 - 20 are related. For event3, I create records 21-30, but make a mistake and I end up deleting 26-30 and add 31-35, so I have 10 jumps. So for event3, records 21-25 and 31-35 are related. Then for a rider I mark records 32 and 33 as being knocked down.

    Now I reorganize the DB. Ninox will reorganize the record IDs of the course table so they are now sequential 1 - 30. But the record for the rider still has it down as records 32 and 33, so it will show nothing. But if you did numbers(multidynamicfield), it will show you the Ids of the actual selection.

    If you have root table that is simple or never sees any deletes then you should never see this issue.

      • BuffaloTony
      • 4 days ago
      • Reported - view

       Oooof okay, this is actually a huge bummer! I have a table that lets me add people to a job. This table also collects a day rate and tracks how many days they work on the particular job of record this is all attached to. In my contact data table i have a little box I can check that will allow me to choose these people in this table (that's my first dynamic choice). 

      Then I have another table, Fred you actually helped me set this all up. This second table is me assigning people to a day. When I add a record, you have a dynamic drop down choice of all the people added to that first table. 

      Now that I'm talking through this with you, I'm starting to see an easier way to build this where I may not run into this problem again. Since I have to re-enter that information into the database anyway I might as well do it so I won't lose it again. The one thing I might lose is my scheduling view that you helped me code with JS and HTML, which I need to retain because that has become a vital tool that my clients LOVE.So I might be coming back to you for help when I have time to reorganize all of this. Thanks for the information!

    • Fred
    • 3 days ago
    • Reported - view
     said:
    The one thing I might lose is my scheduling view that you helped me code with JS and HTML

    You won't lose this. You just have redirect the source of the data from the dynamic field to the new table that you will be creating to store the data.

Content aside

  • 3 days agoLast active
  • 3Replies
  • 34Views
  • 2 Following