How to override lookupReference for reference group in Dynamics Ax 2012 using X++
- Get link
- X
- Other Apps
public Common lookupReference(FormReferenceControl _formReferenceControl)
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange range;
SysReferenceTableLookup sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmWorker), _formReferenceControl, true);
sysTableLookup.addLookupField(fieldNum(HcmWorker, PersonnelNumber));
sysTableLookup.addLookupField(fieldNum(HcmWorker, Person));
sysTableLookup.parmQuery(query);
qbds = query.addDataSource(tableNum(HcmWorker));
range = SysQuery::findOrCreateRange(qbds,fieldNum(HcmWorker,PersonnelNumber));
range.value(SysQuery::valueLikeAfter('10'));
return sysTableLookup.performFormLookup();
}
Comments
Post a Comment