cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Dates?!

Former Member
0 Kudos

Hi All,

Can anyone tell me if it is possible to append a calculation to the current date field.

I am looking to create a form/template for dunning notices and want the form to calculate the current date + 14 days in the body of the text to advise the customer they have 14 days from the current date before court action.

Any ideas?!

Regards,

Ryan Harris

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Project management were keen not to put too much logic/programming in the form itself and keep it to putting it in the call programs in ABAP. As such this has now been resolved!

vaibhav_tiwari
Contributor
0 Kudos

Hi Ryan,

Its possible. For it you have to use the following script:

TextField1.rawValue = Num2Date((Date()+14),"DD/MM/YYYY")

Put this script in the initialize or form:ready event of the TextField/DateField on which you want to display the date.

Just put this field in the layout such that it appears between the line of text you want to display.

for example:

some line...........................(Text1) DateField(To display date)Other part of lines in another texfield.............

Hope it will resolve the issue.

Regards,

Vaibhav Tiwari.

Former Member
0 Kudos

Hi,

I have set up a form:ready event against my date field in my form with the following script entry:

TextField1.rawValue = Num2Date((Date()+14),"DD/MM/YYYY")

I have set it to Javascript and also tried all 3 of the client, server and client server settings, but all it does is display the current date and does not add 14 days!?

Help!

Thanks

Ryan

vaibhav_tiwari
Contributor
0 Kudos

Hi Ryan,

Is it an interactive form or print form. If its a print form just put the code at the form:ready event of the TextField in which you wan to display date or you can also put it into the form:ready event of form1 which appears top in the hierarchy. Else if its a interactive form and you want that the user fills in the current date in the date field after that the date value should get updated in the TextField then write the code in the exit event of the date field where you enter the date.

Hope It helps.

Regards,

Vaibhav Tiwari.

Former Member
0 Kudos

Hi!

It's a print form and the form properties are set to reflect this, as well as having java set as my default script language.

I am currently attaching the script as a form ready event to the floating field to which i have attached the binding for current date. I have also changed the fieldname.rawvalue in the script to the name of the field, so where my field is called the script now reads currentdate.rawvalue etc etc.

Is this correct?

vaibhav_tiwari
Contributor
0 Kudos

Hi,

Just write the script in the form:ready event of the TextField where you want to display a date after 14 days. It will automatically show the date after 14 days from current date.

Regards,

Vaibhav Tiwari.