How to take the CDT's field size

I have in the CDT a field of text box within a specific size.

I'm writing an expression rule that I would like to get the size of the specific field in my CDT.

For example , I've field named "Notes" ,type "VARCHAR(100)"  , so in my expression rule I would like to get the integer 100 .

There is a way to do so?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    As far as I know there's no way to access the field properties like VARCHAR Size from anywhere other than looking in the CDT editor.  If I'm wrong I'd be interested to know because it would allow for interesting additional automations on text input size validations, which thus far we've always had to just handle manually.

  • Yea I'm not sure of any way to pull the field length from the CDT directly, that would be handy though.. 

    One other thought would be to connect CDTs to the system objects in your DB, such as INFORMATION_SCHEMA.COLUMNS for MSSQL.  Then in theory, with the TABLE_NAME and COLUMN_NAME you could retrieve the CHARACTER_MAX_LENGTH.  We have a few reports setup against this data (mostly for troubleshooting), haven't tied in for dynamic length validations.. yet..