Changing the global unique Ninox ID
I am transferring from Filemaker to Ninox. In Filemaker I used the unique ID to generate another ID, which I use to identify my artwork (e.g. ArtID 50240 which came from the unique ID 240 + 50000).
As the Ninox ID´s don´t correspond with the ID´s from Filemaker, I would have to change the Ninox ID in order to match the same ArtID´s as described above and then continue creating new ArtID´s. I understand, that the global unique Ninox ID can change when syncing different versions of the same database. This would also change my ArtID´s, which is unacceptable, as they have to be permanent. Is my understanding correct? If so, I´ll need to find another way to continue creating ArtID´s. Thanks
7 replies
-
@Vos.. I would NOT use the auto generated Id field.. As you did in Filemaker.. Roll your own.. If you plan to always work connected.. You can follow the Invoicing tutorial.. basically .. in an on create trigger
let t:=this;
let maxId := max((select TABLE).ArtID);
t.ArtID := maxId+1
Will give you the max of the ArtID on the table.. then add one to it..
If you will be working in a multi-user environment .. and those users may be disconnected for some time.. Then you will need a different strategy....
Hope this helps.
-
Thanks very much
-
Thank you soooo much, Mconneen. It works like a charm. And this is exactly what I was looking for :-)
(specially because, once the ID is stamped, you can change it manually!
-
"If you will be working in a multi-user environment .. and those users may be disconnected for some time.. Then you will need a different strategy.... "
Could you please elaborate on this? What can happen and what would be a different stategy?
-
@Dean,
Let's assume you and I share a team database that has Table1 that has 10 rows. Now, we both exit WiFi / cell connectivity .. Then each add a row... Using the above.. in both cases, maxId would be 11.
-
Hi Guys, I have a similar problem and am getting the results from the following on trigger formula as incrementing by 1 then 11, then 111 etc., so it is just adding a 1 but not adding that number plus I am losing the GP-00 too.
let t:=this;
let maxId := max((select 'Customer Data'). 'Customer ID');
t.'Customer ID' := maxId+1Help hugely appreciated as I re learn after coming off FMP a long time ago.
-
OK - Changed Customer ID from Text to Number field and now it works.
Just have to work out how to add the suffix GP-00 before each number now :)
Content aside
- 4 yrs agoLast active
- 7Replies
- 3445Views