Morley:
I suspect the culprit is “<= usergroups.length”, a style of looping I’m not familiar with.
Sorry, I was in a hurry. You get a DataSet not an array, take a look at this code:
// Set up the global fields with the user groups
var user_id = globals.sintpro_sec_selected_uid
var user_groups = security.getUserGroups(user_id)
var groups_array = new Array()
for ( i = 1 ; i <= user_groups.getMaxRowIndex() ; i++ )
{
groups_array[i-1] = user_groups.getValue(i,1)
}
globals.sintpro_sec_groups = groups_array.join('\n')
You can use this to populate a global field with the groups a user belongs to separated by CR and to learn how to convert a dataset into an array.