How to add multiple table fields in the form lookup?
suppose i create one table in that i want add lookup in the name field.In lookup contains
-
custTable field name is add
-
in SalesTable field salesId is added
i try in the form lookup method i write below code
public void lookup()
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
;
sysTableLookup = SysTableLookup::newParameters(tablenum(General),this);
sysTableLookup.addLookupfield(fieldnum(CustTable,Name));
sysTableLookup.addLookupfield(fieldnum(SalesTable,SalesId));
sysTableLookup.addLookupfield(fieldnum(CustTrans,AccountNum));
qbds = query.addDataSource(tablenum(General));
queryBuildRange = qbds.addRange(fieldnum(General,Name));
queryBuildRange.value(General_Name.valueStr());
sysTableLookup.performFormLookup();
//super();
}
is it possible to do in this way
Take a look on ProjId extended data type → properties → FormHelp, then go to that form and try to do something like that.
Sales table may contain more than one sales order for one customer in CustTable - which is an 1 to n relation.(CustTable to SalesTable)
CustTrans also may have more than one transaction for one customer - so which records value you want to show in this lookup.
Your approach is not clear.
I belive it will help you to add fields to lookup only from the table added as parameter.
But you can try by adding a method to the lookup. Or you can try by creating a lookup form…(if you want to add fields to lookup from multiple tables)
this codin works only if you have SysMultiTableLookup class:
Query query=new Query();
queryBuildDataSource Qbds,Qbds1,Qbdsw;
SysMultiTableLookup sysTableLookup;
;
qbds= query.addDataSource(tableNum(FirstTable));
//qbds.addrange(“add some ranges normally”)
Qbds1 = Qbds.addDataSource(tableNum(SecondTable));
//Qbds1.addrange(“add some ranges”);
sysTableLookup = SysMultiTableLookup::newParameters(this, query);
sysTableLookup.addLookupField(fieldNum(FirstTable, field),1); //mention the number this number refer the datatable first or second etc…
sysTableLookup.addLookupField(fieldNum(SecondTable, field),2);
SysTableLookup.performLookup();
i want to samething in datasetlookup how to do it can any one reply this