Q&D Action button to set Date Value with Lotus Notes Formula Language

A quick and dirty way for doing this. No error checking, big assumptions about the input to the prompt being right.

1
2
3
4
5
nd := @Prompt([OKCANCELEDIT]; "Enter the New Date"; "YYYY/MM/DD."; @Today);
@If (nd ="";@Return("");"");
y := @Left (nd;"/");
m := @Left(@Right (nd;"/");"/");
d:= @right(@Right (nd;"/");"/");
1
2
FIELD DateFieldOnForm := @Date(@TextToNumber (y) ;@TextToNumber ( m)
;@TextToNumber ( d) )

the Key is parsing the string with @lefts and such, and then TextTonumber, to put humpty Dumpty back together again. The @Date means it is a Date field on the document, not a text string.

The better, clean, way would be to use LotusScript and open a form in Dialog box mode, the form having a Calander tool on it.

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

2 Comments

  1. Posted October 14, 2006 at 8:39 pm | Permalink

    You could always use tmp := @Explode(nd;”/”) and then subscripts on the tmp variable to make the code alittle more compact.

    Sean—

  2. Scott
    Posted October 23, 2007 at 3:42 pm | Permalink

    I’m trying to use my own code and your code but neither seem to work in Domino 7. The @Today part is not working. Any ideas?

    FIELD date :=(@Prompt([OkCancelEdit]; “Enter implementation date”; “Format: MM/DD/YYYY. Ex: 10/01/2007″; @Today));

    and

    nd := @Prompt([OKCANCELEDIT]; “Enter the New Date”; “YYYY/MM/DD.”; @Today);
    @If (nd =”";@Return(”");”");
    y := @Left (nd;”/”);
    m := @Left(@Right (nd;”/”);”/”);
    d:= @right(@Right (nd;”/”);”/”);

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. 19 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
  •  

    October 2006
    M T W T F S S
    « Sep   Nov »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • Spam Blocked