Question
· Aug 20, 2018

How to use %Dictionary API to retrieve some essences of the properties of the class

Given the class name, how could I leverage the %Dictionary API to 

1. Get the ID Key field

2. Check the ID Key field is Integer type.

3. Given a property name, how could I check  there is a UNIQUE constraint/index on it and also the property is Integer type?

Thanks you.

Discussion (4)0
Log in or sign up to continue

1.

SELECT
parent As Class,
Properties
FROM %Dictionary.CompiledIndex
WHERE IdKey=1

2.

SELECT
parent As Class, Name, Type
FROM %Dictionary.CompiledProperty
WHERE Type='%Library.Integer' -- Name='Property' AND parent='Class'

3.

SELECT 1 As "Exists"
FROM %Dictionary.CompiledIndex
WHERE _Unique=1 AND parent = :Class AND Properties = :Property