Expand my Community achievements bar.

date validation failed

Avatar

Level 1

I am trying to do what seems like a fairly simple calculation. User enters one date (AuthFromDate)

in MM/DD/YYYY format and then another date (RecertFromDate) is calculated and displayed

to be 60 days after the entered date. The RecertFromDate field has the ability to be overwritten,

but all the patterns (Display through Data) are set to MM/DD/YYYY.

When I test the form the date appears correctly and is 60 days after the entered date,

BUT I continue to get an error "RecertFromDate validate failed". Also, and this might

help pinpoint the issue, the RecertFromDate field shows 03/01/1900 until you enter

a date into the AuthFromDate.

The following is the script I am using to calculate the 60 days out date:

topmostSubform.Page1.RecertFromDate::calculate - (FormCalc, client)
var AuthFromDateNum = IsoDate2Num(AuthFromDate);
var RecertFromDateNum = (AuthFromDateNum + 60);
var RecertFromDate = Num2Date(RecertFromDateNum, "MM/DD/YYYY");

I have tried to use the following script to initialize either the AuthFromDate and/or

RecertFromDate to see if that would change the 03/01/1900 value, but it does not:

topmostSubform.Page1.RecertFromDate::initialize - (FormCalc, client)
$.rawValue = Num2Date(Date(), "MM/DD/YYYY");

Any ideas of what is happening or how I could fix it would be very appreciated.

Thanks

Renee

1 Reply

Avatar

Level 10

Replace the Calculate event code with the following..

Num2Date(Date2Num(AuthFromDate, "YYYY-MM-DD")+60, "MM/DD/YYYY")

Actually the data format that is coming out of the AuthFromDate field is 2010-03-29. You can get the format by using a messageBox to the AuthFromDate.rawValue.

Thanks

Srini