Skip to main content
victorias96734846
Participant
May 25, 2018
Question

Printing Sequential Invoice Numbers

  • May 25, 2018
  • 1 reply
  • 601 views

I have a form that I want to print sequential invoice numbers. Example: Invoice Number 601541 prints, then Invoice Number 601542 prints, and so on. I want to be able to just click the amount of copies and have it print like that.  Any javascript suggestions?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 25, 2018

It's possible, but would require a separate print command for each copy.

Let's say the field is called "Invoice". You run print the file like this 10 times with different values for it in each copy:

for (var i=1; i<=10; i++) {

     this.getField("Invoice").value = Number(this.getField("Invoice").value)+1;

     this.print({bSilent: true});

}

victorias96734846
Participant
May 25, 2018

Separate print command? I can't just type in the number of copies and it print sequential numbers, like in excel?

And where does this code go? under document javascript or document actions?

try67
Community Expert
Community Expert
May 25, 2018

No, you can't.

Depends on how you want to execute it. A button or from the JS-console would be the best options.