Need help for a script to increment highest number in table (FM11)
I've been looking for a solution to this problem for some time now and have not found an adequate answer.
In my table, the first field is an ordernumber. This field is created using auto increment. When the order is processed, I want to browse back to the relevant record, click a button and generate a second number, a billing number, in the other field. The billing number must equal the highest billing number in the table + 1.
I've tried to make a script that does:
- sort records (billing number)
- select last
- copy field billing number
- go to current record (!?)
- go to field billing number
- paste value
The one step that seems impossible is "go to current record", because filemaker has "forgotten" which record I started with.
At the moment I'm using the demo and am planning to buy the software, but this step is crucial for my application. So if anyone has a clue, I would be extremely grateful.