Hi,
I am trying to return the display value from a popup menu as a argument
I have the following code so far, I know there is probally a simple solution but I am pulling my hair out
var vRecordId = 1
var vQuery = 'SELECT sales_rep.full_name AS sales_rep_full_name, sales_rep.rep_status AS sales_rep_rep_status FROM sales_rep sales_rep WHERE rep_status = ?'
var args = new Array();
args[0] = vRecordId //or new Date()
var vServer = controller.getServerName();
var vDataset = databaseManager.getDataSetByQuery(vServer, vQuery, args, -1);
var vDataArray = vDataset.getColumnAsArray(1); //puts the contents from a column of the dataset into an array
//build menu
var menu = new Array
for ( var i = 0 ; i < vDataArray.length ; i++ ) {
menu[i] = plugins.popupmenu.createMenuItem(vDataArray[i],popMenuActions,null)
}
//create arguments for the method calls
var x = 0
while (menu[x])
{
menu[x].setMethodArguments(x,elemName)
x ++
}
var elem = elements[application.getMethodTriggerElementName()]
if (elem != null)
{
plugins.popupmenu.showPopupMenu(elem, menu);
}
}