?
Solved

Forcing certain days in a date field

Posted on 2003-03-04
4
Medium Priority
?
180 Views
Last Modified: 2013-12-18
I am kind of new to lotus notes development and am still learning. Right now, I have created a form and on the form, I have a date field with calendar control - so when you click on the calendar icon, a calendar pops up allowing you to click on the date from there.
However, I only want the user to be able to click on Fridays.
Is there a way to force this or validate it (eg. only Fridays are enabled on the calendar and everything else is grayed-out) ?

Thanks.
0
Comment
Question by:lauren4110
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:pratigan
ID: 8067167
I use a similar date field without a calendar pop up.  The date field is a drop down list that defaults to the upcoming Friday, but allows selection of defferent fridays.  The code is:
in the default field: thisfriday:=@Adjust(@Date(@Now); 0; 0; (6 - @Weekday(@Date(@Now))); 0; 0; 0);
@Text(thisfriday)
in the drop down list formula window:
thisfriday:=@Adjust(@Date(@Now); 0; 0; (6 - @Weekday(@Date(@Now))); 0; 0; 0);
s5:= @Text(@Adjust(thisfriday;0 ; 0 ;7*5;0;0;0));
s4:= @Text(@Adjust(thisfriday;0 ; 0 ;7*4;0;0;0));
s3:= @Text(@Adjust(thisfriday;0 ; 0 ;7*3;0;0;0));
s2:= @Text(@Adjust(thisfriday;0 ; 0 ;7*2;0;0;0));
s1:= @Text(@Adjust(thisfriday;0 ; 0 ;7;0;0;0));
s01:= @Text(@Adjust(thisfriday;0 ; 0 ; -7;0;0;0));
s02:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*2);0;0;0));
s03:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*3);0;0;0));
s04:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*4);0;0;0));
s05:= @Text(@Adjust(thisfriday;0 ; 0 ;- (7*5);0;0;0));
temp:= @Trim(s05:s04:s03:s02:s01:@Text(thisfriday):s1:s2:s3:s4:s5);
@Trim(@Replace(temp;@Text(@DbLookup("":"";"";"Name";1));""))
Hope this is something you can use.
:)
0
 
LVL 7

Accepted Solution

by:
scottrma earned 200 total points
ID: 8067445
You may not be able to grey-out particular dates on the calendar, but you can validate the date that the user entered and either allow or deny the save:

@If(@Weekday(MyDateField) != 6; @Failure("You may only choose a Friday for this date field!"); @Success)

Put the above formula into the InputValidation event for the field in question.

Regards,

Scott
0
 
LVL 5

Expert Comment

by:AndrewJayPollack
ID: 8068491
I wonder if you could create a fake calendar resource, like a room or something-- busy it for the days you don't want it available, and use @functions that list the availability?   That might be an interesting way to go-- if complicated.
0
 

Author Comment

by:lauren4110
ID: 8072858
Not entirely what i was initially looking for, but works for me! Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question