Working with the Calendar

  1. Is it possible to turn off the edit property of a datetime field and yet allow the user to continue to use the calendar to set a change of date? My current experiments suggest it’s not. If the field is not editable, the user can still gain access to the calendar but it has no effect.

In many circumstances I’d prefer to limit editing of dates to the calendar only, keep end users out of the tricky area of entering dates in invalid forms. Possible?

  1. Is there a validation procedure available to prevent an end user from entering a non-valid date in a datetime field? In some cases the previous valid date is restored, but in others a SQL error message comes up.

Morley:

  1. Is it possible to turn off the edit property of a datetime field and yet allow the user to continue to use the calendar to set a change of date? My current experiments suggest it’s not. If the field is not editable, the user can still gain access to the calendar but it has no effect.

The only way to really disable editing of a date field is to make it a textfield (with editing disabled)

Morley:
2. Is there a validation procedure available to prevent an end user from entering a non-valid date in a datetime field? In some cases the previous valid date is restored, but in others a SQL error message comes up.

I guess you could catch it with the onRecordSave event.

Morely,

for question 1): :idea: why don’t you try to make a method that uses application.showCalendar() to solve this? You disable that field and place a button that runs a method which shows a calendar. If the users chooses a date, you put the value returned from showCalendar into your field.