[Form]
public class MKCustomLookupForm extends FormRun
{
[DataSource]
class MKCustomDSTable
{
[DataField]
class FieldIdCust
{
/// <summary>
/// </summary>
/// <param name = "_formControl">Form control</param>
/// <param name = "_filterStr">Fileter condition, if any</param>
public void lookup(FormControl _formControl, str _filterStr)
{
CustTable custTable;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(MKTable), _formControl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = query.addDataSource(tablenum(MKTable));
queryBuildDataSource.addSortField(fieldNum(MKTable, FieldId), SortOrder::Ascending);
sysTableLookup.addLookupfield(fieldnum(MKTable, FieldId), true);
sysTableLookup.addLookupfield(fieldnum(MKTable, FieldName));
sysTableLookup.parmQuery(query);
//logic
sysTableLookup.parmTmpBuffer(fieldList);
sysTableLookup.performFormLookup();
}
}
}
}