newbie: getValuelistItems error

Hi all

This is my maiden post. :lol: I tried searching but didn’t quite get the answer I was looking for.

I need to show a select dialog with items from my value list. Instead of getting a drop down list with the items from my custom value list, I am getting:

JSDataSet:size:3, selectedRow=-1

What am I missing here?

FWIW, there are 3 items in my value list.

var array = application.getValueListItems(‘valuelistname’);
var selectedValue = plugins.dialogs.showSelectDialog(‘Select’,‘please select a name’, array)

Thanks.

Leng

XP
1.4.2_03-b02

you have first to convert a JSDataSet to a array (of one column in the set)

var array = application.getValueListItems(‘valuelistname’).getColumnAsArray(0);
var selectedValue = plugins.dialogs.showSelectDialog(‘Select’,‘please select a name’, array)

var array = application.getValueListItems(‘valuelistname’).getColumnAsArray(0);
var selectedValue = plugins.dialogs.showSelectDialog(‘Select’,‘please select a name’, array)

getColumnAsArray(1) seem to work.

Thanks Johan.