Hi All ,
I have create a form where we have multiple string control on the selection of the value next string control value need to been filter .
Hence when i open the form everything work as expected . But when i go an change the value from the first control . Value in the second control is showing the older value
Code written on the form control
Company lookup and modified
public void lookup()
{
Query query = new Query();
QueryBuildDataSource qbds = query.addDataSource(tableNum(DATAAREA));
qbds.clearRanges();
qbds.addSortField(fieldnum(DATAAREA, ID));
qbds.addOrderByField(fieldnum(DATAAREA, ID));
qbds.orderMode(OrderMode::GroupBy);
qbds.addSelectionField(fieldNum(DATAAREA,ID));
msctrlcompany = SysLookupMultiSelectctrl::constructWithQueryRun(element,Company,query,false,selectedField);
super();
}
/// <summary>
/// modified method
/// </summary>
/// <returns></returns>
public boolean modified()
{
boolean ret;
ret = super();
CustGroup.enabled(true);
CustGroup.text("");
return ret;
}
Code on the CustomerGroup
public void lookup()
{
Query query = new Query();
QueryBuildDataSource qbdsCustomer;
qbdsCustomer= query.addDataSource(tableNum(CustGroup));
qbdsCustomer.clearRanges();
List listCompany;
ListIterator itrCompany;
listCompany = new List(Types::String);
listCompany = strSplit(Company.valueStr(),“;”);
itrCompany = new ListIterator(listCompany);
while(itrCompany.more())
{
qbdsCustomer.addRange(fieldNum(CustGroup, DataAreaId)).value(queryValue(itrCompany.value()));
itrCompany.next();
}
qbdsCustomer.addSelectionField(fieldNum(CustGroup, CustGroup));
selectedField1 = [tableNum(CustGroup), fieldNum(CustGroup, CustGroup)];
mmsctrlcompanyGroup= SysLookupMultiSelectCtrl::constructWithQuery(element,CustGroup,query,false,selectedField1);
super();
}