Is there a function available that would allow me to access a CDT's field properties, i.e. the Length of a Text field on a CDT?
Discussion posts and replies are publicly visible
To avoid having lots of constants, you can create a single index map based on the runtime type of ri!entity. Although you will still have to manually maintain it from the database schema.
getNameLengthForEntity(entity): with( local!type: runtimetypeof(ri!entity), if( local!type = type!EntityType1, 40, local!type = type!EntityType2, 100, local!type = type!EntityType3, 200, error("unknown type: " & local!type) ) )