In the ‘DIALOG’ method, we include a new field of the desired type on which
we will do the lookup and we override its lookup method as follows:
1 2 3 4 5 6 7 8 9 10 | public Object dialog() { DialogRunbase dialog = super(); dlgOperationalPoint = dialog.addFieldValue(extendedTypeStr(PhysicalOperationalPoint),operationalPoint); dlgOperationalPoint.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(MyUIBuilderClass, OperationalPointLookup), this); return dialog; } |
In a new class or an existing class, we create a new method that references
the Lookup and performs the necessary search:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | private void OperationalPointLookup(FormControl _formControl) { SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(table), _formControl); Query query = new Query(); QueryBuildDataSource queryBuildDataSource = query.addDataSource(tableNum(table)); queryBuildDataSource.addRange(fieldNum(table, fieldNum)).value(this.parmFieldValue()); queryBuildDataSource.addRange(fieldNum(table, VendAccount)).value(this.parmVendAccount()); queryBuildDataSource.addOrderByField(fieldNum(table, PhysicalOperationalPoint)); queryBuildDataSource.orderMode(OrderMode::GroupBy); sysTableLookup.addLookupfield(fieldNum(table, PhysicalOperationalPoint)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); } |
No hay comentarios:
Publicar un comentario