Using the code example below, I want to show how to override the lookup method of a RecId/RefRecId field. Such a lookup is also referred to as a Referencelookup.
The example serves quite concretely to be able to select a financial dimension, but only one of the type cost center.
The example serves quite concretely to be able to select a financial dimension, but only one of the type cost center.
public Common lookupReference(FormReferenceControl _formReferenceControl) { SysReferenceTableLookup sysRefTableLookup; Query lookupQuery = new Query(); QueryBuildDataSource lookupQueryDataSource; sysRefTableLookup = SysReferenceTableLookup::newParameters( tableNum(DimensionAttribute), _formReferenceControl); sysRefTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name)); lookupQueryDataSource = lookupQuery.addDataSource(tableNum(DimensionAttribute)); lookupQueryDataSource.addRange( fieldNum(DimensionAttribute, BackingEntityType)).value( queryValue(tableNum(DimAttributeOMCostCenter))); lookupQueryDataSource.addRange( fieldNum(DimensionAttribute, Type)).value( queryValue(DimensionAttributeType::ExistingList)); sysRefTableLookup.parmQuery(lookupQuery); return sysRefTableLookup.performFormLookup(); }