Hi,
Please follow these steps to fix the problem if you had not already fixed this. The multi select drop down selection should filter the second multi select drop down.
i took an example of inventsite and inventlocation as example
In the class declaration of the form , have the necessary declarations for multiselectCtrl along with the QueryRun objects
public class FormRun extends ObjectRun
{
SysLookupMultiSelectCtrl siteCtrl,locationCtrl;
QueryRun locationQueryRun;
Query q;
QueryBuildDataSource qbd;
}
// In the init function of the form instantiate the two controls respectively. the
msCtrlLocation , SiteCtrl are the two StringEdit Controls on the form with autoDeclaration to Yes
q = new Query();
qbd = q.addDataSource(TableNum(InventLocation));
qbd.addRange(FieldNum(InventLocation, InventSiteId));
locationQueryRun = new QueryRun(q);
super();
locationCtrl = SysLookupMultiSelectCtrl::constructWithQueryRun(element, msCtrlLocation, locationQueryRun);
siteCtrl = SysLookupMultiSelectCtrl::construct(element, SiteCtrl, queryStr(InventSiteQry));
In the modified function of Site Control which is siteCtrl
boolean ret;
int i;
str siteID;
ret = super();
// Assign the selected site values into string siteid (which is a comma seperated site ids..)
if (ret)
{
// siteContainer = ; // get actual value of the selected rows
siteID = con2Str(siteCtrl.getSelectedFieldValues());
}
// Get the Query from the same QueryRun that was used in the init function on the form, if we use a seperate one it wont work.
In our case it is locationQueryRun
q = locationQueryRun.query() ;
qbd = q.dataSourceTable(tableNum(InventLocation));
qbd.clearRange(fieldNum(InventLocation, InventSiteId));
// Pass the comma Seperated SiteID to addRange
qbd.addRange(fieldNum(InventLocation, InventSiteId)).value(siteID);
// RefreshQueryRun with the modified QueryRun
locationCtrl.refreshQueryRun(locationQueryRun);
The second multi Select list will be filtered based on the selection
Hope this helps
Thanks