validate date fields before saving

  • 1
  • 2
  • Question
  • Updated 2 years ago
  • Answered
I want to record the dates on which a boat will be leaving and returning to their dock.  I don't want the return date to predate the departure date.  I see how I can use a dynamic message to warn the user of invalid dates, but it lets them save it anyways.  (Seems to me that "prevent save" would be a good action to include in dynamic forms.)  But that doesn't seem to be an option.  I thought maybe a formula field holding the duration between the two dates would also work, but I don't see how the calculated field would be validated.  Am I missing something, or is this a glaring gap in the product design?
Photo of Thommango

Thommango

  • 160 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
  • 2
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I suggest using a dynamic form rule.

When the record is saved

In the following conditions are true

Departure date is less than an arrival date

Action

Abort the save with the following message

Sorry but the record was not saved. The departure date is before the arrival date. Please correct your data and try again
Photo of Thommango

Thommango

  • 160 Points 100 badge 2x thumb
Ah, I didn't see notice that I could include conditions other than those related to field actions.  Thanks.