Lookup
DataSource
public void lookup(FormControl _formControl, str _filterStr)
{//;
//journalFormTable.designLookupJournalName(_formControl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
// Create an instance of SysTableLookup where 'this'
// is the current form control.
SysTableLookup sysTableLookup =
SysTableLookup::newParameters(tablenum(InventJournalName), _formControl);
;
// Add fields to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldnum(InventJournalName,JournalNameID ));
sysTableLookup.addLookupfield(fieldnum(InventJournalName, Description));
// Limit and arrange the data selection.
queryBuildDataSource = query.addDataSource(tablenum(InventJournalName));
queryBuildRange = queryBuildDataSource.addRange(
fieldnum(InventJournalName, BSEInOutType));
queryBuildRange.value(QueryValue(BSEInOutType::NoProdPick));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
FormDesign
public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
// Create an instance of SysTableLookup where 'this'
// is the current form control.
SysTableLookup sysTableLookup =
SysTableLookup::newParameters(tablenum(BS_PUR_TVendTypeTable), this);
;
// Add fields to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldnum(BS_PUR_TVendTypeTable,BsVendTypeID ));
sysTableLookup.addLookupfield(fieldnum(BS_PUR_TVendTypeTable, BsVendTypeName));
// sysTableLookup.addLookupField(fieldNum(BS_PUR_TVendTypeTable, BsVendType));
// Limit and arrange the data selection.
queryBuildDataSource = query.addDataSource(tablenum(BS_PUR_TVendTypeTable));
queryBuildRange = queryBuildDataSource.addRange(
fieldnum(BS_PUR_TVendTypeTable, BsVendType));
queryBuildRange.value(enum2str(BS_PUR_TVendTypeRelation.BsVendType));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
//Don't call super() (commented out in the code).
// super()
}