Home > Domino Tips > Developer > LotusScript > Create a non-specified date picker with LotusScript code
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Create a non-specified date picker with LotusScript code


Petri Niemi
11.18.2008
Rating: -2.75- (out of 5)


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Most Lotus Notes Domino date pickers are tied to a
Related resources from SearchDomino.com:
Set date without time via LotusScript

Tutorial: 30 LotusScript tips

LotusScript Learning Guide

specific field; however, there is a way to use a date picker that isn't associated with a specific field. With just a few adjustments, you can use Domino's embedded date picker and dialog box to do this.

The trick here is that every time you change the value of your embedded date picker, three items are updated: $DatePickerDay, $DatePickerMonth, $DatePickerYear. Use these fields to obtain the day, month and year of your selected day in your embedded date picker.

Here are a few additional steps to ensure this works correctly:

  1. Code a button that creates a temporary Lotus Notes document and opens a dialog box. This dialog box will use the temporary document as a parameter.
  2. Create a dialog form that includes an embedded datepicker element, as well as a computed field for the date chosen from your $DatePickerDay, $DatePickerMonth and $DatePickerYear fields.
  3. Append the corresponding values from the current date in the $DatePickerDay, $DatePickerMonth and $DatePickerYear fields in the PostOpen of your dialog form and mark your SaveOptions item as "0."
  4. Save your work. This button should allow you to pick a selected date, month and a year or a computed field with the date from temporary document items.
  5. Next, modify the following fields in your dialog form to editable numbers: $DatePickerDay, $DatePickerMonth and $DatePickerYear.
  6. Save the form and close it.
  7. Re-edit the form and delete the aforementioned fields.

Place this LotusScript code in the button created in Step 1. This will open the dialogbox with a dialog form that includes your embedded date picker.

LotusScript to code button for datepicker
(Click on code for enlarged view and script download.)

Use this code in the date picker dialog form's QueryOpen event.

Code to use in Queryopen event
(Click on code for enlarged view and script download.)

Finally, here is some sample code for the computed field of the date picker dialog form, which adds the day, month and year to the date value.

@Text($DatePickerDay) + "." + @Text($DatePickerMonth) +
 "." + @Text($DatePickerYear)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Petri Niemi. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts