0

Automatically populate fields in new record

I have a flat file database on my iPhone that I use to track data during travels in my RV. I initiate a new record each day. Of the 28 fields, I would like the new record to populate data from the last record for 4 fields. For example, Start Miles (number) on the new record would be populated from Stop Miles (number) from the previous record.
Last Refuel (number) would be repeated from the previous record.
Towed miles (number) on the new record would be populated by Total (number) from the previous record.

Previously I was told to place this entry in the "On Create" section of the Options edit table. (for Start Miles)
let prvId :=
number(last(select Travel).Id - 1;
let newRec := this;
newRec.('Start Miles' ;=
number((select Travel where Id = prvId).'Stop Miles'))

That didn't work. Plus, I attempted to use the same statement for other fields, but Ninox would not accept.
As a novice, I am trying to learn from the on-line tutorial, but find it difficult to apply examples to the iPhone. Any answers you can provide would be appreciated. Thank you.

1 reply

null
    • Sean
    • 4 yrs ago
    • Reported - view

    A7D6FFEE-DB6F-4967-8128-DE3F2A6C9A92

Content aside

  • 4 yrs agoLast active
  • 1Replies
  • 1215Views