• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Limit digit input on Form with a decimal value field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Limit digit input on Form with a decimal value field

    Hello, I noticed that if I have a form with a decimal field and that field is a decimal 4 in the data source(cast(0 AS decimal(4)) AS glsub2,) the user can type more than the 4 digits. I then set validation to stop them and it will round that value to the highest number (9999).
    If that field is a character field, it will stop that user at 4 digits. The only problem now is that the user can type in characters. I can still use formatting to show an error, I was wondering why I can't get similar behavior as a green screen where it won't let the user type in digits and also stop them at 4 digits.
    Any idea?
    Thanks.

  • #2
    If you want your field to be treated as only 4 decimals I think you want to define it as "cast(0 as decimal(4,4)) as glsub2"

    Comment


    • #3
      Hello Sean,
      I should clarify. I don't want 4 decimal places. What I'm trying to do is limit a field to only 4 digits. The only way I have figured out how to do that is to have the field set up as a character field.
      If the field is a decimal field, this is what can happen,
      image.png?
      This field is defined like this.
      cast(0 AS decimal(4)) AS glsub2
      I am able to type more than 4 digits, however, I do get an error and the field does get reset to 9999. The question was is there a way to do that with a numeric field or is this something that should be a possible feature request?
      Honestly, I'm creating an app that is similar to a green screen app, and during data entry, the cursor bumps from the 4-digit field to the next field. I want to do that with the form, but if the field lets the user type in more than 4 digits, it won't be the same. I can get the field to cooperate if it's a character field.
      Thanks.

      Comment


      • #4
        In the next 6.3 update, the form number fields will stop accepting input if the user enters more than what the field can hold, functioning like text fields. For example, in the given field, CAST(0 AS DECIMAL(4)) AS glsub2, if I enter "8888" and then try to enter another digit, nothing will happen, and the value will remain "8888."

        Comment


        • #5
          That sounds good Johnny. Thanks.

          Comment

          Working...
          X