AnsweredAssumed Answered

Scripting Puzzle - Set Next Serial Value confusion

Question asked by LightningAd on Feb 5, 2009
Latest reply on Feb 5, 2009 by Orlando

Title

Scripting Puzzle - Set Next Serial Value confusion

Post

 

Having finally worked out how to resolve a problem i have had in getting a serial number to reset to 001 upon reaching 999, i have found a problem that i cannot understand.

 

I added some more script to the Set Next Serial Value example as shown in the filemaker pro help files

 so it now reads:

 

Go to new record/request/page(last) 

if [tvc::serial >=999]

set next serial value [tvc::serial; tvc::serial=1]

else

 set next serial value [tvc::serial; tvc::serial+1]

end if

new record/request

 

 

this works in that when it encounters a serial on the previous page that is 999 or more it reverts to back 000 - and then begins to climb the numbers again from there.

 

...the only problem is that it goes back to zero when the script tells it to go back to restart from number 1 ?

 

 

I posted this at the end of a previous thread where the solution was being sought...but due to the length and obscure subject title, I have renamed it and posted specifically for this one issue...apologies if you have read this twice.

 

Adam 

Outcomes