controller.find();
if (globals.Field1_number)
{
subj_num = globals.Field1_number
}
var x = controller.search();
if (x ==0 )
{
//Nothing was found
var btn = globals.Error_MSG('No matches found for ’ + globals.Field1_number, ‘Cancel’, ‘Try Again’ );
if (btn == ‘Try Again’)
{
globals.Field1_number = null
}
else
{
controller.loadOmittedRecords();
}
}
///
Once I call the above method I get the following error:
Error:
Java.lang.illegalArgumentException: Cannot format given Object as a Date(Search_Subj_num, line 10)
///
Line 10 is:
var x = controller.search();
The above script works fine in any other forms that we have.
I recreated the form, but still errors upon calling the above method.
which version of servoy do you use?
That exception doesn’t seem to be one of servoy itself (if conversion of dataproviders don’t work) so it seems to go somewhere else wrong.
If youre are testing with 2.2RC7 then i would like to have a reproduceable solution.
Servoy developer version: R2 2.1.2-build 315
Table name: ABC
Form name: ABC
Here is what I have done so far:
Created a new global variable with type “Number” and still getting the same error.
Duplicated the form, and still getting the same error.
Recreated the same form and method, and still getting the same error.
I created a new solution with a new ABC form, and then tried the script. It works fine.
Enabled the debugger and points to line: var x = controller.search