Solved

Domain min max isn't working?

  • 15 February 2021
  • 1 reply
  • 47 views

Userlevel 3
Badge +4

Hi,

I'm trying to set a domain (TINYINT) to a min value of 1 and a max value of 99: https://www.screencast.com/t/zJI2tieP

How does this work in the background? I cannot find any references in the deployment source code and when I do an Update Model in app I can still fill in a value of 0 without getting any error.

Any ideas on what I'm missing here?
 

icon

Best answer by Mark Jongeling 15 February 2021, 15:09

View original

1 reply

Userlevel 7
Badge +23

Hi Alban,

Using these min/max value field will result in an automatic DB Check constraint. After Generating definitions, you will see a Generated record in Data model > Tables > Check constraints.

 

That does mean the source code for Checks have to be generated and executed on the database. 

Code of check code file

If you want give a message to the user upon filling in the value, you will have to resort to using the Default procedure and using tsf_send_message to show the user a message upon exceeding the desired boundaries.

Hope this helps!

Reply