Unique Record Id & Id Field - strange behaviour
I'm finding that using (Mac OS Mojave 10.14.6) the internally generated Id field in calculations/scripts tends to produce odd results.
I'm trying to build a database and tables to manage various accounts. In a table of credits and debits, I'm trying to calculate a running balance field. I've used the Id field to manage the calculation, doing a sum from the first record to the current record. However, a variety of different calculations/scripts have failed to work. The most successful could have 10, 20, 30 records where the calculation worked and then a record where it didn't. It seemed as though in some records my variables were picking a value from thin air.
I tried to stop this by explicitly setting all variables to zero and then assigning a value - didn't work.
I have solved the problem by creating a function field Record# with the simple calculation number(Id).
The running balance calculation then references Record# not Id - it all works!
I've just discovered the manual refers to a value/field (?) recordId for selecting records - my setup doesn't recognise this although record(tablename, Id) does extract the Id value .....
I am puzzled by the unique record Id field and how to use it in calculations - or if I should even try ....
1 reply
-
Since you didn't post your formula, I can only give you general information. If you don't get the output you expect with
Idthen usenumber(Id)in your formula. You could probably do that in your formula without creating a separate formula field.record(TableName, Id)doesn't extract the Id, but rather takes it as an argument and returns matching record information if it exists.
Content aside
- 5 yrs agoLast active
- 1Replies
- 1186Views
