Manage Learn to apply best practices and optimize your operations.

Dynamically calculate an adjusted date

Calculate a notification date that is X number of days prior to a due date.

The Problem:
Calculate a notification date that is X number of days prior to a Due Date with the user to provide the X value.

I created 3 fields.
One called DueDate that was an editable Time field set to Date Only and Defaulted to Today.

A second called Number that was an editable number field, no decimals and Defaulted to 0.

A third field "AdjustedDate that is a Time field, set to Date only and Computed to itself.

I placed the code below in the Exit event of the Number field. Whenever someone moves through that field it recalulates the AdjustedDate field based on the DueDate adjusted by the Number field value.

An agent looks to the AdjustedDate field and on that date, mails a reminder notice to the appropriate person advising that their DueDate is approaching.

 Sub Exiting(Source As Field) Dim ws As New NotesUIWorkspace Dim uidoc As NotesUIDocument Dim doc As NotesDocument Set uidoc = ws.CurrentDocument temp = uidoc.FieldGetText("Number") temp2 = temp * -1 Set doc = uidoc.Document Dim tDate As New NotesDateTime(doc.DueDate(0)) Call tDate.AdjustDay(temp2) doc.AdjustedDate = tDate.DateOnly End Sub

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...