public Common lookupReference(FormReferenceControl _formReferenceControl)
{
Common ret;
SysReferenceTableLookup sysReferenceTableLookup;
QueryBuildDataSource qbdsPositionDetails,qbdsJobDetails,qbdsJob;
HcmJob _HcmJob;
Query query = new Query();
sysReferenceTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmJob),_formReferenceControl, true);
// sysReferenceTableLookup.parmUseLookupValue(false);
qbdsJob = query.addDataSource(tableNum(HcmJob));
qbdsPositionDetails = qbdsJob.addDataSource(tableNum(HcmPositionDetail));
qbdsPositionDetails.relations(true);
qbdsPositionDetails.addRange(fieldNum(HcmPositionDetail,Department)).value(queryValue(HCMResRequirement.Department));
// qbdsPositionDetails.orderMode(OrderMode::GroupBy);
//qbdsPositionDetails.addSortField(fieldNum(HcmJob,JobId));
sysReferenceTableLookup.addLookupField(fieldNum(HcmJob,JobId));
sysReferenceTableLookup.addLookupMethod(‘description’);
sysReferenceTableLookup.parmQuery(query);
_HcmJob = sysReferenceTableLookup.performFormLookup();
return _HcmJob;
}