Depending on your how your app works. You could just setup an Auto-Enter on the EndDate field. Check the calculated value and then enter StartDate
You may need to use a script trigger onObjectModify (StartDate) which would run a script to set field EndDate to StartDate.
To expand on that, What S Chamblee suggests should not cause any major issues with your scripts set to use these to dates to find records within the specified date range.
You could set the EndDate to auto-enter a value based on this calc:
Get ( ActiveFieldName ) = "EndDate" ; Self ;
Unless I get it wrong, the script trigger enters a date in the EndDate field, which is not wanted. Also, if at a later time the StartDate is modified, it triggers a modification to EndDate; with the auto-enter calculation, it is impossible to leave the field blank. However, I think you pointed me in the right direction. I added a boolean to the script:
If [IsEmpty (Dates ::EndDate) ]
Set Field [Dates ::EndDate; Dates ::StartDate]
I am halfway there. Entering a date in the first field makes the second one to navigate to the same date; modifying the 1st field does not modify the 2nd one. But I still get this automatic entry in the second field, which is not desirable...
Unless I get it wrong, the script trigger enters a date in the EndDate field, which is not wanted.
Why is this not wanted? What problems does this cause for you? Any that I can guess at all seem pretty easy to adjust for.
I have a series of drop-down calendars, related to events planning:
- “order” (auto-enter creation date)
- “ship to”
- “target delivery”
- “installation start”
- “installation end”
- “show open”
- “show end”
- “dismantling start”
- “dismantling end”
- “ship from”
As mentioned in the original post, when you click an empty drop-down calendar, it displays today’s date by default (without entering it). When preparing an order for an event where the “target move-in date” is, for example, September 10, 2013, users must navigate in each of the following drop-down calendars from today’s date to September 2013 to enter data. It is, to say the least, annoying and why I would like these calendars to automatically navigate to September 2013 once the “target move-in date” is entered.
At the same time, since some of the other dates may not be known when the order is created, I don’t want any dates (besides the order date) to be automatically created.
On the EndDate field set a script trigger onObjectEnter then in your script would be
set field [EndDate;StartDate]
You could do this for each field and just change Endate to the name of the other date fields.
Again, this does not look to me like a major problem. There are any number of ways to adjust your layout design to adapt for a default value in the "end date" fields that exactly matches the start date fields. One simple option is to use conditional formatting to make the contents of the end date field invisible if their value equals the value in the start date field.
"how can I have the EndDate drop-down calendar display the selected date from the StartDate field, but without entering a date unless the user does select one?"I have found a way to do what you asked ( empty EndDate field with same calendar month and year of StartDate ).It uses two triggers ( OnObjectEnter and OnObjectValidate ).I could post an example but I need to know if EndDate could ever be minor or equal to StartDate.