Skip to main content
Solved

Domain min max isn't working?

  • February 15, 2021
  • 1 reply
  • 50 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!

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • 3939 replies
  • 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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings