AnsweredAssumed Answered

Need help for a script to increment highest number in table (FM11)

Question asked by JopUrsem on Sep 15, 2010
Latest reply on Sep 16, 2010 by philmodjunk

Title

Need help for a script to increment highest number in table (FM11)

Post

Hello,

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.

Outcomes