on AOT datasets fields method, add this code below :
void dataSetLookup(SysDataSetLookup sysDataSetLookup) { List list = new List(Types::String); Query query = new Query(); // Add the table to the query. query.addDataSource(tableNum(HcmLeaveType)); //filter query query.dataSourceTable(tableNum(HcmLeaveType)).addRange(fieldNum(HcmLeaveType,ValidToCredit)).value(SysQuery::value(NoYes::Yes)); /* uncomment if the relation is not based on reference recid // Specify the fields to use for the lookup. list.addEnd(fieldStr(HcmLeaveType,LeaveTypeId)); list.addEnd(fieldStr(HcmLeaveType,Description)); // Supply the set of lookup fields. sysDataSetLookup.parmLookupFields(list); // Specify the field that is returned from the lookup. sysDataSetLookup.parmSelectField(fieldStr(HcmLeaveType,LeaveTypeId)); sysDataSetLookup.parmHideSelectField(true); */ // Pass the query to the SysDataSetLookup so that the query is used. sysDataSetLookup.parmQuery(query); }
preview after lookup filtered by code :
reference on MSDN :
https://msdn.microsoft.com/en-us/library/hh830903.aspx