api.vLookup()

The method api.vLookup() has been deprecated in 14.0 version.

Deprecated Usage

Groovy
def countryCode = "DE"

def countryName = api.vLookup("Country", "CountryName", countryCode)
def currency = api.vLookup("Country", "Currency", countryCode)

QueryApi Usage

The method api.vLookup() is designed to cache values. Therefore, you must either implement your own caching mechanism or directly attach the company parameter to another database query if you require the cache solely for the purpose of making a join.

Groovy
def countryCode = "DE"

def qapi = api.queryApi()
def t1 = qapi.tables().companyParameterRows("Country")
def country = qapi.source(t1, [t1.CountryName, t1.Currency], t1.CountryCode.equal(countryCode))
        .stream { it.find() }

def countryName = country?.CountryName
def currency = country?.Currency

Result

Country Name

Currency

Germany

EUR

See Also