Error when using getRowAsArray method on JS dataset

Hello,

I receive that error mesage when I try to use getRowAsArray function:
Type error: Error is not a function : (On Load line11 )

var servoyUser = security.getUserName()
var servoyUserId = security.getUserId()
var systemUser = security.getSystemUserName()
var colNbr = security.getUserGroups(servoyUserId).getMaxColumnIndex()
var rowNbr = security.getUserGroups(servoyUserId).getMaxRowIndex()
var dataset1 = security.getUserGroups(servoyUserId)
///.getAsText(String column_separator, String row_separator, String value_delimiter, boolean addColumnNames)
var text = dataset1.getAsText('/', ';', ''  , false)
var group = dataset1.getValue(1, 2)
var dataArray1 = dataset1.getRowAsArray(1)

The dataset is well loaded as I use it with the

getValue

method , but why can I not use the

getRowAsArray

method.

What’s wrong ?

Thanks for help.

That is very strange. I just tried exactly your code and it works fine for me. Are you sure that the user you are working with really is assigned to any groups (you say that getValue works, so it should be)? What Servoy version are you using?

I am using the following version of Servoy :

Servoy Developer
Version R2 2.2.4-build 336
Java version 1.4.2_05-b04 (Windows XP)

I put in annexe a print screen with the value of variable when I execute the method ?

The problem is perhaps link to something on my PC ?

Thanks.

DomTom

That is really strange. What is the exact error that you get? Could you start Servoy using the servoy_developer.bat and have a look at the full error that should be printed there? Maybe there is a problem with the Java version you are using in combination with arrays (the current Java version is 1.5.0_06-b05). There have been some problems with arrays coming from plugins, but I don’t know if that was dependent on the Java version.

Other question: what are you trying to do with that method in general?

Hi patrick,

Thanks again,

Now it runs perfectly with Java version is 1.5.0_06-b05.
I will test again other things for which I have some problems also.

As I am new with SERVOY and Java, I was just testing the method getRawAsArray for future purpose.

See you.

DomTom.

:D :D

Hi DomTom,

I also recognized this behavior a couple of times. Also with Java 1.5.0_06-b05 and Servoy 3. But it’s not reproducable. When it occured I restarted Servoy Developer. After a restart, the same code which produced an error before, was now working. Strange!

Hans-Peter