Manage Learn to apply best practices and optimize your operations.

Agent to replace Date field values

This tip describes how to create an agent to replace date field values.

If you'll try to use a usual procedure(doc.ReplaceItevValue) for changing values of Date/time fields, you'll fail to do it, becouse this procedure is changing the field type to text.

Here is a code that solves this problem:

Suppose you have a field "date" which stores some date values you are about to change...

 Code: Sub Initialize Dim w As New NotesUIWorkspace Dim dc As NotesDocumentCollection Dim doc As NotesDocument Dim Item As NotesItem Dim nDate As NotesDateTime Set dc=w.CurrentView.Documents If dc.Count>0 Then d=Format(Cdat(Inputbox ("Please input a new date value", "New date")),"") Set nDate=New NotesDateTime(d) Set doc=dc.GetFirstDocument While Not (doc Is Nothing) Set item=doc.GetFirstItem("date") Set item.DateTimeValue=nDate Call doc.Save(True,True) Set doc=dc.GetNextDocument(doc) Wend End If End Sub

Dig Deeper on Domino Resources - Part 2

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