Error converting to object

When I run the following two methods, I get:

org.firebirdsql.jdbc.TypeConvertionException: Error converting to object. Error converting to object.

First Method:

//loadfiles[clientload]
//for ( var i = 0 ; i < controller.getMaxRecordIndex() ; i++ )
//{
//controller.recordIndex=i
var a = [‘’,clastname,cfirstname,cmiddlename,clientname,caddress,‘’,ccity,cstate,czip,csalut,csuffix]
if ( utils.stringPatternCount(indivcorp, ‘Corp’)>= 1 )
{
a[0]=‘Corporate’
}
else
{
a[0]=‘Individual’
}

forms.name.loadName(a);
namenameid = globals.returnedNameId

//}
forms.clList.controller.showRecords(Object)

Second Method:

//loadName[name]
/* This method relies on the following parameter list being passsed to it:
0. Individual/Corporate designation

  1. Last Name
  2. First name
  3. Middle Name
  4. Organization Name
  5. Address Line 1
  6. Address Line 2
  7. City
  8. State
  9. Zip
  10. Salutation
    11 Suffix
    */

controller.newRecord()
indivcorp=arguments[0]
namelast=arguments[1]
namefirst=arguments[2]
namemiddle=arguments[3]
organization=arguments[4]
nameaddress1=arguments[5]
nameaddress2=arguments[6]
namecity=arguments[7]
namestate=arguments[8]
namezip=arguments[9]
namesal=arguments[10]
namesuf=arguments[11]
controller.saveData()
globals.returnedNameId=nameid

I am reading record in a table and creating a record in another table, while passing the data to be entered into the second table as array elements. I thought this would be pretty simple stuff. What am I missing?

This seems a bug to me, wrong type should never result in db error in Servoy, Servoy checks all types before being sending to db.
Are all your columns text?
Can you reproduce this problem in small solution or sent us the solution so we can fix this problem?

Ok i have seen youre problem..
it is a problem in youre method code.

you do this:

var a = [‘’,clastname,cfirstname,cmiddlename,clientname,caddress,‘’,ccity,cstate,czip,csalut,csuffix]
forms.name.loadName(a);

then in the loadName method you do this:

indivcorp=arguments[0]
namelast=arguments[1]

so you think that the arguments (var args in javascript) of the method is exactly youre array you make above.
This is not the case!
arguments[0] is youre array itself…
so

var youreArray = arguments[0]
indivcorp=youreArray[0]
namelast=youreArray[1]

You can use the arguments array the way you do now but then you have to call youre loadName differently:

so not with youre array:

forms.name.loadName(a);

but:

forms.name.loadName(‘Invidual’,clastname,cfirstname,cmiddlename,clientname,caddress,‘’,ccity,cstate,czip,csalut,csuffix);

then arguments[0] = ‘Invidual’ ect.

So javascript maps the arguments you give with a method call to that arguments array. And if youre argument is only one (which is an array) it will be stored in the first entry of the arguments array itself.

:D AHH HAAA! Thanks. Works great now!

We also made it inpossible that wrong types are tried to be inserted in db.