[Last Call] Learn how to a build a cloud-first strategyRegister Now


LotusScript to Add 1 year to Date/Time Field

Posted on 2011-04-20
Medium Priority
Last Modified: 2013-12-18
Hi all,

I'm currently working on a lotus database for storage of information that requires a yearly review.

For the view display purposes, I would like to have a field that will show the date last saved  + 1 year.

Is there any LotusScript that can do this based on the document save date or the date within an existing field?

Question by:QldMatt
  • 2
LVL 13

Accepted Solution

CRAK earned 2000 total points
ID: 35432903
Dim dateTime as NotesDateTime
Set dateTime = New NotesDateTime( doc.GetItemValue("datefield")(0)) ' assuming you have already obtained doc
Call dateTime.AdjustYear(1)
Call doc.ReplaceItemValue(dateTime.LsLocalTime)
' don't forget to save
LVL 13

Expert Comment

ID: 35432932
If you want to use the last saved date: use doc.LastModified. It'l return a variant.
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35433065
View? Column? No lotusScript there. Try

@Adjust(datefield; 1; 0; 0; 0; 0; 0)

Author Closing Comment

ID: 35436509
Thanks CRAK.

Added this to the existing Querysave of the form and works well.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

830 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