1.Created two tables and on e form
2. Take an EDT and give relation to PCustomerTable.CustomerId and extends to outbound control on form(openmode:edit)
3.
In clicked method
PCustomerTable_ds.filter(fieldNum(PCustomerTable,CustomerId),FilterButton.valueStr());
4.
2. Take an EDT and give relation to PCustomerTable.CustomerId and extends to outbound control on form(openmode:edit)
3.
In clicked method
PCustomerTable_ds.filter(fieldNum(PCustomerTable,CustomerId),FilterButton.valueStr());
4.
For multiple selection:
In form methods:
public void multiLookup()
{
Query query = new Query();
QueryBuildDataSource qbds;
qbds = query.addDataSource(tableNum(PCustomerTable));
msCtrlCust = SysLookupMultiSelectCtrl::constructWithQuery(element, CustomerIDFilter, query);
}
public void init()
{
super();
element.multiLookup();
}
public class FormRun extends ObjectRun
{
SysLookupMultiSelectCtrl msCtrlCust;
container values;
}
5. In PCustomerTable -->executequery()
public void executeQuery()
{
PCustomerTable ptc;
PItemTransactions pit;
query query;
QueryBuildDataSource qbds,qbds1;
QueryBuildRange qbr;
QueryRun qr;
int i;
int64 r;
container c;
;
query = new query();
qbds = query.addDataSource(tableNum(PCustomerTable));
qbds1 = qbds.addDataSource(tableNum(PItemTransactions));
qbds1.relations(true);
values = msCtrlCust.get();
for (i = 1; i <= conLen(values);i++)
{
r = conPeek(values,i);
Ptc = PCustomerTable::find(r);
c = conIns(c,i,Ptc.CustomerId);
}
qbds.addRange(fieldNum(PCustomerTable,CustomerId)).value(con2Str(c));
qr = new QueryRun(query);
while (qr.next())
{
ptc = qr.get(tableNum(PCustomerTable));
PCustomerTable_ds.query(qr.query());
}
super();
}