Error on setting default date

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni

Chandi,

On which version of CommCare are you receiving this error?

-Clayton

··· On Fri, Apr 27, 2012 at 6:43 AM, Chandni wrote:

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni

I am getting this error in version 2.0.

Thanks, Chandni

··· On Fri, Apr 27, 2012 at 7:43 AM, Clayton Sims wrote:

Chandi,

On which version of CommCare are you receiving this error?

-Clayton

On Fri, Apr 27, 2012 at 6:43 AM, Chandni chandnidhanjal@gmail.com wrote:

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni

When you say that you are setting the default date to “today()” how are you
doing so? In Vellum? Using what field, exactly?

-Clayton

··· On Fri, Apr 27, 2012 at 11:58 AM, Chandni Dhanjal wrote:

I am getting this error in version 2.0.

Thanks, Chandni

On Fri, Apr 27, 2012 at 7:43 AM, Clayton Sims csims@dimagi.com wrote:

Chandi,

On which version of CommCare are you receiving this error?

-Clayton

On Fri, Apr 27, 2012 at 6:43 AM, Chandni chandnidhanjal@gmail.comwrote:

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni

Yeah, I was trying to set it in Vellum using “Default Data Value” in
advanced properties.

In order to reconfirm the problem with using today() function in vellum, I
tried to rebuild an old 2.0 app that I was able to build and test on phone
in the past; the rebuilding of this previously working app failed and threw
the same error as mentioned earlier “java.lang.IllegalArgumentException:
Invalid cast of data [today()] to type Date.”

-Chandni

··· On Fri, Apr 27, 2012 at 10:19 AM, Clayton Sims wrote:

When you say that you are setting the default date to “today()” how are
you doing so? In Vellum? Using what field, exactly?

-Clayton

On Fri, Apr 27, 2012 at 11:58 AM, Chandni Dhanjal < chandnidhanjal@gmail.com> wrote:

I am getting this error in version 2.0.

Thanks, Chandni

On Fri, Apr 27, 2012 at 7:43 AM, Clayton Sims csims@dimagi.com wrote:

Chandi,

On which version of CommCare are you receiving this error?

-Clayton

On Fri, Apr 27, 2012 at 6:43 AM, Chandni chandnidhanjal@gmail.comwrote:

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni

Ah, ok, I see what’s going on.

The Default Data Value field in Vellum is only compatible with actual data
(a specific date), not with xpath expressions, unfortunately. That’s
something we’ll be adding support for in CommCare 2.0 in the future, but
wasn’t something we supported in the past.

In ODK, all date entry fields default to the current date, so you shouldn’t
need to set that value explicitly.

-Clayton

··· On Fri, Apr 27, 2012 at 1:48 PM, Chandni Dhanjal wrote:

Yeah, I was trying to set it in Vellum using “Default Data Value” in
advanced properties.

In order to reconfirm the problem with using today() function in vellum, I
tried to rebuild an old 2.0 app that I was able to build and test on phone
in the past; the rebuilding of this previously working app failed and threw
the same error as mentioned earlier “java.lang.IllegalArgumentException:
Invalid cast of data [today()] to type Date.”

-Chandni

On Fri, Apr 27, 2012 at 10:19 AM, Clayton Sims csims@dimagi.com wrote:

When you say that you are setting the default date to “today()” how are
you doing so? In Vellum? Using what field, exactly?

-Clayton

On Fri, Apr 27, 2012 at 11:58 AM, Chandni Dhanjal < chandnidhanjal@gmail.com> wrote:

I am getting this error in version 2.0.

Thanks, Chandni

On Fri, Apr 27, 2012 at 7:43 AM, Clayton Sims csims@dimagi.com wrote:

Chandi,

On which version of CommCare are you receiving this error?

-Clayton

On Fri, Apr 27, 2012 at 6:43 AM, Chandni chandnidhanjal@gmail.comwrote:

Hi,

I am getting a validation error on setting default data value as
today() for the date question type in cchq form. I have set default
date type to “today()” many times in the past (in both, version 1.3
and 2.0) but never had an error before.
For debugging purposes, the exact error I am receiving is
"java.lang.IllegalArgumentException: Invalid cast of data [today()] to
type Date."

Will appreciate if someone can look into it and provide some help.

Thanks,
Chandni