Skip to main content
Answer

Domain min max isn't working?

  • February 15, 2021
  • 1 reply
  • 56 views

Forum|alt.badge.img+6

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?
 

Best answer by Mark Jongeling

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!

This topic has been closed for replies.

1 reply

Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • Answer
  • February 15, 2021

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!