Multi Select Look Up in Form
{
SysLookupMultiSelectCtrl msCtrlCust;
QueryBuildDataSource qbds;
QueryBuildFieldList qbfl;
}
------------------------------------------
public void init(){
Query query = new Query();
super();
qbds = query.addDataSource(tableNum(CustTable));
qbds.fields().dynamic(NoYes::Yes);
qbfl = qbds.fields().addField(fieldNum(CustTable, AccountNum));
msCtrlCust = SysLookupMultiSelectCtrl::constructWithQuery(element, CustMultiLookUp_AccountNum, query);
}
---------------------------------------
void clicked()
{
container con;
int i;
str multiSelectString;
Args args;
container values = msCtrlCust.get();
super();
args = new Args();
for (i = 1; i <= conLen(values); i++)
{
con = conIns(con,1,conPeek(values,i));
}
multiSelectString = con2Str(con,',');
args.parm(multiSelectString);
new MenuFunction(menuitemDisplayStr(CustMultiLookUpData), MenuItemType::Display).run(args);
}
---------------------------------------------
No comments:
Post a Comment