this.getField("InvoiceNumber").value = new Date().valueOf();
Okay. How about this. The above code generates a 13 digit number. What could I do to change the code so it would cut the number down to, say, 9 digits?
Use this code instead:
this.getField("InvoiceNumber").value = util.printf("%09d", Math.floor((Math.random()*Math.pow(10,9))+1));