Written by

Question Mark OReilly · Mar 27

In custom ultility function extending ens.rule.functionset want a method with parameter of lookup tables

Currently have an extension of the ..lookup function as a custom version of the lookup. Is there any easy way to get it to display it as a list of the lookup tables 

ClassMethod LookupV3(table As %String = "",

and the one i'm trying with 

v3

Product version: IRIS 2025.3

Comments

Julian Matthews · Mar 27

Hi Mark.

Do you mean that you're trying to have a drop down in the "table" field when using your custom lookup function?

If so, I don't think this is possible as the logic for this seems to be buried in a system zen page that is explicitly looking out for both the "Lookup" and "Exists" function by name to give this behaviour.

0
Mark OReilly  Mar 30 to Julian Matthews

Thanks that is what the vibe i got and what AI leant towards. 

I see now it is baked in this tIsLookup bascially saying it needs to be in the Ens Rule function set or Util function set and it's called Lookup or for the exists function. It is no problem it was just an ask if missed something, can always select the standard one if need the lookup dropdown then write v2 afterwards. 

Set tIsLookup = ((tClassName = "Ens.Rule.FunctionSet") || (tClassName = "Ens.Util.FunctionSet")) && ((tFunctionName = "Lookup") || (tFunctionName = "Exists"))
0
Robert Cemper · Mar 27

Basically, this query might provide the content you are looking for:

SELECT distinct TableName FROM Ens_Util.LookupTable

or simply $LB formatted output:

SELECT List(distinct TableName) FROM Ens_Util.LookupTable

or as JSON Array

SELECT JSON_Array(tablename) json from (
SELECT List(distinct TableName) tablename FROM Ens_Util.LookupTable)
0
Mark OReilly  Mar 30 to Robert Cemper

Thanks this looks right and indeed i think a correct answer for use in other classes. 

I gave this a go pretty much (less elegantly)

SELECT List(distinct TableName) FROM Ens_Util.LookupTable
Parameter SETTINGS = "LookupTableName:selector?context={MyApp.Utils.LookupHelper.GetLookupTableNames}";
Property LookupTableName As %String;

In my case like Julian says think it's baked into the zen page within the dtl editor

0