I have an issue where I have set the custom value of a value list successfully to a sql statement using a method as follows:
var query = 'SELECT concat(u.first_name," ",u.last_name) as account_manager FROM ss_users u, ss_users_group_assignments uga WHERE uga.user_id=u.id AND u.enabled=1 AND u.talent_id < 1 AND uga.group_id= 7 GROUP BY u.id ORDER BY u.last_name, u.first_name';
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 250);
Here’s the issue though: I need the primary key to be stored in the field displaying either the “pk - first name last name” or just “first name last name” and when the user selects the value the pk is stored in the field.
Does anyone have any pointers on how to achieve this?
This is what you get if you right click on application.setValueListItems() and choose “move sample”:
//Fill a custom type valuelist with values from array(s) or dataset
//set display values (return values will be same as display values)
application.setValueListItems(‘my_en_types’,new Array(‘Item 1’, ‘Item 2’, ‘Item 3’));
//set display values and return values (which are stored in dataprovider) //application.setValueListItems(‘my_en_types’,new Array(‘Item 1’, ‘Item 2’, ‘Item 3’),new Array(10000,10010,10456));
//do query and fill valuelist (see databaseManager for full details of queries/dataset)
//var query = ‘select c1,c2 from test_table’;
//var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 25);