api.findLookupTable()

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

Deprecated Usage

Groovy
def lookupTable = api.findLookupTable("Regions")

New Usage

In new implementations, utilize the method api.find("LT"). Following the release of version 15.0, the QueryAPI should be employed in place of api.find("LT").

Groovy
getAtdef date = new Date() 

def filter = Filter.and(
        Filter.equal("uniqueName", "Regions"),
        Filter.lessOrEqual("validAfter", date),
        Filter.equal("status", "ACTIVE"),       
        Filter.isNull("simulationSet"),
)

def lookupTable = api.find("LT", 0, 1, "-validAfter", filter)?.getAt(0)

Result

JSON
{
  "version" : 0,
  "typedId" : "2435.LT",
  "uniqueName" : "Regions",
  "validAfter" : "2021-01-01",
  "status" : "ACTIVE",
  "type" : "MATRIX",
  "valueType" : "MATRIX",
  "nodeId" : 384,
  "hideWarnings" : false,
  "lastUpdateByName" : "daniel",
  "createdByName" : "daniel",
  "name" : "Regions",
  "numberOfKeyFields" : 1,
  "createDate" : "2023-09-08T15:04:41",
  "createdBy" : 440,
  "lastUpdateDate" : "2023-09-08T15:04:41",
  "lastUpdateBy" : 440,
  "id" : 2435,
  "isPlasma" : false
}

See Also