1/09/2012

Auto Increment Permit Numbers By Ten (ZP 32 & ZP SQL)

I had a customer ask if there was a way to have the auto numbering feature for permits increment by 10 instead of just one. You can do this by adding a script to the "Add" function of any screen. This script uses "Building" as the Module, "Building" as the Screen, and "Add" as the Action. The script is:

newcert = left(cert, len(trim(cert))-4) +padl(alltrim(str(val(right(trim(cert),4))+9)),4,"0")
replace cert with newcert

This script add an extra 9 to the auto generated new permit number to make it increment by a total of ten. This script will work for any of the permit screens in either ZP 32 or ZP SQL.