I am trying to overwrite the lookup() method of a string field on a datasource.
Here is the code
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(PurchLine), _lookupCtrl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSourceLine = query.addDataSource(tableNum(PurchLine));
queryBuildDataSourceLine.addRange(fieldNum(PurchLine, isDeleted)).value(queryValue(NoYes::No));
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield(fieldNum(PurchLine, PurchId));
sysTableLookup.addLookupfield(fieldNum(PurchLine, InventTransId), true);
sysTableLookup.addLookupfield(fieldNum(PurchLine, ItemId));
sysTableLookup.performFormLookup();
Hopefully, I want to make the order of columns is: purchId -> InventTransId -> ItemId, this is the default order if calling super() method.
But actually, the order is: InventTransId -> PurchId -> ItemId.
Seems like it put the returnItem to the first place by default.
So my question is that is it possible to change the order when create SysTableLookup?
Or I should create a lookup form instead of using SysTableLookup?