public static void routOprNameLookup(FormControl _control, InventRefId _inventRefId) { Query query; //QueryBuildDataSource qbdsNonConf; QueryBuildDataSource qbdsProdRoute; QueryBuildDataSource qbdsRouteOpr; QueryBuildRange qbr; SysTableLookup tableLookup; tableLookup = SysTableLookup::newParameters(tableNum(RouteOprTable), _control); query = new Query(); qbdsRouteOpr = query.addDataSource(tableNum(RouteOprTable)); qbdsProdRoute = qbdsRouteOpr.addDataSource(tableNum(ProdRoute)); qbdsProdRoute.joinMode(JoinMode::InnerJoin); qbdsProdRoute.addLink(fieldNum(RouteOprTable, OprId), fieldNum(ProdRoute, OprId)); qbr = qbdsProdRoute.addRange(fieldNum(ProdRoute, ProdId)); qbr.value(_inventRefId); tableLookup.addLookupfield(fieldNum(RouteOprTable, OprId)); tableLookup.addLookupfield(fieldNum(RouteOprTable, Name)); tableLookup.parmQuery(query); tableLookup.performFormLookup(); }
Hello,
I'm working on extension of "InventNonConformanceTableCreate" form.
The datasources there are "InventNonConformanceTable" and "inventDim" (I do not do any modification on InventDim table).
What I did is:
- I have added RefRecId field in "InventNonConformanceTable" table and made a relation to RecId of "RouteOprTable" table.
- I drag this RefRecId field to the InventNonConformanceTableCreate form, which created the reference group.
- I set the "Replacement field group" to "Auto report" which shows both fields of RouteOprTable table, but the problem here is that it displays all the records of RouteOprTable.
What I want to achieve:
- To have one additional field displayed within this reference group lookup from "ProdRoute" table, field "OprNum".
- As said on point 3 above, I want to filter the records based on the relation of InventNonConformanceTable and ProdRoute. The lookup should show the "OprNum, "OprId" and "Name" of the Operation that is selected on InventNonConformanceTable.
I tried different approaches with onLookup event, but was not able to achieve the desired solution.
I tried to code this, I call this method from onLookup event, but with it reference group lookup is not even opened:
*This post is locked for comments