public void lookup()
{
QueryBuildDataSource
queryBuildDataSource;
SysTableLookup lookup;
QueryBuildRange queryBuildRange;
Query
query;
query = new
Query();
// Add
the first data source to the query
queryBuildDataSource =
query.addDataSource(tableNum(JournalizingDefinition));
// Add
the range to this first data source
queryBuildRange =
queryBuildDataSource.addRange(fieldNum(JournalizingDefinition,
JournalizingDefinitionModuleValue));
// Set
the range
queryBuildRange.value(enum2str(JournalizingDefinitionModuleId::GeneralLedger));
lookup =
SysTableLookup::newParameters(tableNum(JournalizingDefinition),
this, true);
lookup.parmQuery(query);
// Add
the fields to be shown in the lookup form.
lookup.addLookupfield(fieldNum(JournalizingDefinition,
JournalizingDefinitionCode));
lookup.addLookupfield(fieldNum(JournalizingDefinition,
JournalizingDefinitionDesc));
lookup.addLookupfield(fieldNum(JournalizingDefinition,
JournalizingDefinitionModuleValue));
//
Perform the lookup.
lookup.performFormLookup();
}
--------------------------------------------------
public void lookup(FormControl _formControl, str _filterStr)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(ProdBOM), _formControl);
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange qbr;
;
sysTableLookup.addLookupField(fieldnum(ProdBOM, itemid));
sysTableLookup.addLookupMethod('itemName');
qbds = query.addDataSource(tablenum(ProdBOM));
if(Rejection_ProdId.valueStr())
{
qbds.addRange(fieldnum(ProdBOM, prodid)).value(Rejection_ProdId.valueStr());
}
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
Note : Lookup can be created by
1) By Relations
2) By Method
3) By EDT
4) By AutoLookup
5) By TitleField1 and TitleField2
No comments:
Post a Comment