alert message 30 days before the expiration date

Jun 05, 2019

Copy link to clipboard

Copied

hello

i could to find a script to run auto fill date (current date) when you open the file called "todaysDate"

// variable to store whether document has been opened already or not

var bAlreadyOpened;

function docOpened()

{

if(bAlreadyOpened != "true")

{

// document has just been opened

var d = new Date();

var sDate = util.printd("mm/dd/yyyy", d);

                // set date now

                app.alert("About to insert date into field now");

this.getField("todaysDate").value = sDate;

// now set bAlreadyOpened to true so it doesn’t

// run again

bAlreadyOpened = "true";

}

else

{

// document has already been opened

}

}

// call the docOpened() function

docOpened();

but i want to get alarm message and red frame like the required fields on the expiration date field when the current date field becomes (within and after ) the last 30 days of the expiration date field "enddate" 

thank you in advance

You can read about date and time scripting here:

https://acrobatusers.com/tutorials/date_time_part1

Date and Time Handling - Information and Scripts(Script pages at bottom)

You can change the border color of a field with the "strokeColor" of the field. You'll also need to set the "width" property if the field does not currently have a border.

var oFld = this.getField("theField");

oFld.strokeColor = color.red;

oFld.width = 1;

But you have another problem. What does it mean to open the PDF the first time?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

172

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

alert message 30 days before the expiration date

Jun 05, 2019

Copy link to clipboard

Copied

hello

i could to find a script to run auto fill date (current date) when you open the file called "todaysDate"

// variable to store whether document has been opened already or not

var bAlreadyOpened;

function docOpened()

{

if(bAlreadyOpened != "true")

{

// document has just been opened

var d = new Date();

var sDate = util.printd("mm/dd/yyyy", d);

                // set date now

                app.alert("About to insert date into field now");

this.getField("todaysDate").value = sDate;

// now set bAlreadyOpened to true so it doesn’t

// run again

bAlreadyOpened = "true";

}

else

{

// document has already been opened

}

}

// call the docOpened() function

docOpened();

but i want to get alarm message and red frame like the required fields on the expiration date field when the current date field becomes (within and after ) the last 30 days of the expiration date field "enddate" 

thank you in advance

You can read about date and time scripting here:

https://acrobatusers.com/tutorials/date_time_part1

Date and Time Handling - Information and Scripts(Script pages at bottom)

You can change the border color of a field with the "strokeColor" of the field. You'll also need to set the "width" property if the field does not currently have a border.

var oFld = this.getField("theField");

oFld.strokeColor = color.red;

oFld.width = 1;

But you have another problem. What does it mean to open the PDF the first time?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

173

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 05, 2019 0
Jun 06, 2019

Copy link to clipboard

Copied

You can read about date and time scripting here:

https://acrobatusers.com/tutorials/date_time_part1

Date and Time Handling - Information and Scripts(Script pages at bottom)

You can change the border color of a field with the "strokeColor" of the field. You'll also need to set the "width" property if the field does not currently have a border.

var oFld = this.getField("theField");

oFld.strokeColor = color.red;

oFld.width = 1;

But you have another problem. What does it mean to open the PDF the first time?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 06, 2019 0
Jun 09, 2019

Copy link to clipboard

Copied

the file for validation licenses for the pilots

i will put the last dates before the company opening the file for the first time

thank you so much for your answer

it worksss

you always help us

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 09, 2019 0