Override lookup method of Form Control


public void lookup()
{

SysTableLookup        sysTableLookup;
Query                 query=new Query();
QueryBuildDataSource  qbds;

;
sysTableLookup=SysTableLookup::newParameters(tablenum(MyTable),this);

sysTableLookup.addLookupfield(fieldnum(MyTable,Field1));
sysTableLookup.addLookupfield(fieldnum(MyTable,Field2));

qbds = query.addDataSource(tablenum(MyTable));

qbds.addRange(fieldnum(MyTable, UserId)).value(curExt());

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

Comments