SNTT : Don’t hard code your Selectedable Years in a Lotus Notes dialog box.

Hard coding is bad, bad , bad. Very bad, okay? (see Avoiding Hard Coding of Group Names).

Here’s a quick and dirty way to have a drop down dialog which selects the “Year” and not be hard coded.

1
2
3
4
currentYear := @Year(@Now );
@Text(currentYear-1) :
@Text(currentYear) :
@Text(currentYear+1)

which results in a multip value list of (for this year) “2008″ : “2009″ : “2010″

and then make the default value

1
@Text(@Year(@Now ))

and, of course, you could easily extended this forward or back additional year values if needed.

This entry was posted in Lotus Domino, Show-n-Tell+Thursday. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
  • Follow

  • Archives (since 2003)

  • Categories

  • Recent Posts

  • Twitter Updates

    • I liked a YouTube video -- Recycle your unwanted electronics - City of Toronto http://youtu.be/91OXkMkesBc?a 13 hours ago
    • I'm organizing and coordinating my Japan Trip with Google Wave. Seeing both the promise and the fail. of the product. 18 hours ago
    • I have failed my saving Throw against Shiny ... I new 32G iPod Touch is on order :) 1 day ago
  • del.icio.us links

  • Flickr

    Hanging Gardens of KensingtonHanging Gardens of KensingtonMore Chocolate CakeMore Chocolate Cake
  •  

    August 2009
    M T W T F S S
    « Jul   Sep »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • Spam Blocked