Id Numbers Change?
Why do Id numbers change when I close a database and then open it again?
11 replies
-
Hi Mr. K.,
the IDs change if you work offline on different devices and synchronize when you are online.
Best, Alex
-
Then I don’t understand the value of the ID numbers if the app can change them. Please explain. Thanks.
-
- You have two devices: A and B
- both are offline
- You connect to the same database with both devices
- You create 100 records on both devices
- they will habe the id from 1 - 100 on both devices
- now you synchronize the databases
- IDs need to be unique
- an algorithm will re-arrange the IDs to match
-
OK, so it's a way for Ninox to match them on synchronized devices. So If I want to have an Id number that doesn't change, then I assume I need to add my own Id number field. How do I set up that number field so Ninox inserts a sequential and unique number for each record? Thanks.
-
I agree Mr. K. If
Id sequential numbers must not change as they are unique references that could be used in querys and related updates then if ninox DB needs some kind of keys that change after sync they must be different and probably hidden references. Thanks
-
I agree JAFD, I see no value for me to an Id number that changes, aside from I see it in one place, and I can find it in another place. But I do need a unique and sequential number to be created by Ninox at the time of record creation, and a number that does not get changed by Ninox. A number that can be used as an invoice number or a customer number. How do I make a field that creates that type of number?
-
Isn't there a problem that even if you can create a unique invoice number/reference offline in more than one place then there is going to be conflict on synchronisation? Surely the number/reference needs to be created on synchronisation rather than on creation?
Not at all sure whether that would be possible with Ninox but I have implemented to cater for similar in the past. As JAFD implies, a key allocated on record creation (maybe device number & timestamp) which maps to a real invoice number created on synchronisation. Of course, the key and invoice mapping would need to be stored for future processing.
Just my thoughts.
-
Not sure what all of that means. I still need to know how do I have Ninox create a unique record number on creation that does not and cannot be changed by Ninox?
-
You can use a formula like the following with the trigger „on create“ at the table.
let before := max((select Table_C).Record_Nr);
Record_Nr := before + 1;
'Record_Nr (as text)' := format(today(), "YYYY_MM_DD_") + format(before + 1, "000“)Best, Jörg
-
It would be much easier if Ninox had a field option to do this simple function which I believe is basic to any database. This use of a complex formula is too difficult.
-
i agree, have been struggling with this for an hour now
Content aside
- 6 yrs agoLast active
- 11Replies
- 5634Views