Forum Discussion

KatieBardwell's avatar
KatieBardwell
Qrew Member
5 years ago

how do i prevent typographical errors to the date field?

I want to create a rule that kicks back in error when a date is before 1997 and after 2027 but I don't need the error to fire if the date field is blank.  I've tried this with the new table base rules but I am getting the error when it is blank.  

6 Replies

  • AustinK's avatar
    AustinK
    Qrew Commander
    One thing to keep in mind with a form rule on a date field is if the date field is the last or only thing they interact with on the record they usually need to click out of the field to make the form rule fire. So if they enter a wrong date and then immediately go down and save, the record will save with the invalid date. 

    Another issue I have encountered using form rules for date validation is there are other steps a user can take to input an invalid date even without that being the last field they click. In the past I've tried to make it so it clears the date when it is invalid but that fails randomly. I haven't been able to 100% pin it down but if they interact with the date field and input an invalid one and the form rule kicks in sometimes it will not kick in a second time and allow the user to input whatever they want without another error and they can save it.

    Form rules are not perfect for data validation so it might come down to training and just making sure the user fully understands what they should be doing. It can help to add helper text near the field that shows what you expect to be entered and what a bad entry would be, if this field is a problem.
  • You can use the new feature called data validation.  You make a formula field to calculate an error message or calculate to blank.  If blank then the record will save, else it will not save.  This also works for grid edit and imports.

    Data Validation is set on the Advanced settings for the table.
  • I re-read you original post and it appears that you were trying to use the new feature.  Can you post your formula?  Also what message do you get when you try to save the record with good dates.
  • I suggest that you build your actual formula in a normal formula field box so you can debug it there and see the results.

    You formula is incorrect, but because its a screen shot I can't help you edit it, I would need to see the actual code.