Skip to main content
Participant
August 26, 2016
Question

Printing a expiration date on a form?

  • August 26, 2016
  • 2 replies
  • 541 views

I need to print documents with a date that shows the document has or will expire 30 days after the document was printed. 

I have learned how to print the date of the printing directly on the document.  I have not learned how to add 30 days to the date the form was printed.

This topic has been closed for replies.

2 replies

Participant
August 26, 2016

my code used now is:

var f = this.getField("DatePrinted");

        f.hidden = false;

        f.value = "This Document was printed on: " + util.printd("mmm dd, yyyy", new Date());

try67
Community Expert
Community Expert
August 26, 2016

Use this code:

var f = this.getField("DatePrinted");

f.display = display.visible; // change to display.noView if want it to appear only on the printed copy, and not on the screen

var d = new Date();

d.setDate(d.getDate()+30);

f.value = "This Document was printed on: " + util.printd("mmm dd, yyyy", d);

try67
Community Expert
Community Expert
August 26, 2016

Are you using a script to do it? If so, please post the code you have so far and we'll help you adjust it.

Participant
August 26, 2016

I have posed by script