lookup contactperson

void lookup()
{
Query query;
QueryRun queryRun;
QueryBuildDataSource qbdContact;
QueryBuildDataSource qbdDirPerson;
QueryBuildDataSource qbdcust;
QueryBuildDataSource qbdLogAddress;
DirPartyRecId custParty;

SysTableLookup sysTableLookup;

query = new Query(queryStr(smmContacts_NoFilter));

qbdContact = query.dataSourceTable(tableNum(ContactPerson));//.findRange(fieldNum(ContactPerson, CustAccount));
qbdContact.addRange(fieldNum(ContactPerson, CustAccount)).value(BFFProjWizTable.CustAccount);

qbdDirPerson = qbdContact.addDataSource(tableNum(DirPerson));
qbdDirPerson.fetchMode(JoinMode::InnerJoin);
qbdDirPerson.relations(false);
qbdDirPerson.addLink(fieldNum(ContactPerson, Party), fieldNum(DirPerson, RecId));

sysTableLookup = SysTableLookup::newParameters(tableNum(ContactPerson),this);
sysTableLookup.addLookupfield(fieldNum(ContactPerson,ContactPersonId));

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

}