{
SysLookupMultiSelectCtrl msCtrl;
}
Override the init method of the form and place the below code
public void init()
{
super();
// TestCtrl – Name of control on which you want a lookup.
// StudentCourse – Query to get the lookup data
msCtrl = SysLookupMultiSelectCtrl::construct(element, TestCtrl, querystr(StudentCourse));
}
That’s it, Now let’s see how the selected rows are returned from the lookup.
On clicking the Ok button all the selected values are returned in the String control.
To get the values and RecId of the selected rows, simply override the modified method of the TestCtrl and add the below code.
public boolean modified()
{
boolean ret;
container c,v;
int i;
ret = super();
if (ret)
{
c = msCtrl.get(); // get RecIds of the selected rows
v = msCtrl.getSelectedFieldValues(); // get actual value of the selected rows
for (i = 1; i <= conLen(c);i++)
{
info(conPeek(c,i));
info(conPeek(v,i));
}
}
return ret;
}