Project and Portfolio Management Practitioners Forum
cancel

Block out a date in calendar

SOLVED
Go to solution
Highlighted
chateau_1
Trusted Contributor.

Block out a date in calendar

Currently, I have a date field with the "Date" validation. When a user clicks on that field, a date picker will pop up, allowing users to select any dates.

My requirement is this:

If the selected date falls on a RED Day, then an error message should pop up, indicating that date is not available for selection. The challenge is that there are numerous RED days throughout the calendar and it varies all the time. Has anybody encountered this?


3 REPLIES
Erik Cole_1
Outstanding Contributor.
Solution

Re: Block out a date in calendar

You could create a regional calendar with your RED days as non-working days. Create a rule to compare the selected date with the days in that calendar and trigger a popup from that.
chateau_1
Trusted Contributor.

Re: Block out a date in calendar

Thanks Erik.
This is the exact approach that I took.

1) The user enters a Requested Date (see attached) that has a timestamp on it.
2) I set up the Red Days using the Regional Calendar (which only has the Date with no timestamp on it, which is fine)
3) I then truncated the requested date and compared the two dates.
4) Based on the result of the comparison, if the two dates are the same, the value (EVENT_CODE) flag will be returned (i.e HOLIDAYS, RED_DAYS, etc...)

Here's the problem:
5) I set up a rule upon field change that anytime the flag is = to RED_DAYS, a pop up should appear but it never does. This prompt should be popped up before the ticket can be submitted.

It seems that â apply on field changeâ is applicable only when it comes to user-driven (click on mouse, type in field) and not system-driven.

Any other ideas that you can think of? I want the pop up to appear as soon as the user selects a Red day at NOT SUBMITTED state.

chateau_1
Trusted Contributor.

Re: Block out a date in calendar

found a work around