Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


PauloSergio Silveira 12.Apr.06 11:07 AM a Web browser
Applications Development 6.5.4 Windows XP


Hi, all

This is the scenery I have:
The IBM application I created was based off on the Lotus Notes Mail R6 Template. The customer wants to create Calendar events and tasks and wants to control them for different teams (he also wants a consolidated calendar for all teams). I did that.
The customer wants to import a spreadsheet with several appointments and tasks at once. I did that too.
Basically, I created an agent to run against those newly imported docs to "Complete Import of Calendar" items. But the problem is to set up the CalendarDateTime field correctly.
I have been trying to handle with a multiple days event, that would have an startDate and a different endDate imported values.
As per my understanding, the CalendarDateTime field should then be filled in with a list of dates, starting with the startDate value and ending with the endDate value, but it should not have the time stamp on the dates (so the event would be an all day event and should not be tied to an specific start time, thinking of a world wide used application).
If you see my code below, I try to put only dates on the CalendarDateTime field, but I have noticed that somehow the time stamp is in the field after all.

Sub HandleWithDates( doc as NotesDocument )
Dim item As NotesItem
Dim startDate As New NotesDateTime( "" )
Dim startTime As New NotesDateTime( "8:00 AM" )
Dim startDateTime As New NotesDateTime( "" )
Dim endDate As New NotesDateTime( "" )
Dim endTime As New NotesDateTime( "6:00 PM" )
Dim endDateTime As New NotesDateTime( "" )

Set item = doc.GetFirstItem( "StartDate" )
If item Is Nothing Then Exit sub
Set startDate = item.DateTimeValue
Call startDate.SetAnyTime
Set item.DateTimeValue = startDate

Set item = doc.GetFirstItem( "EndDate" )
If item Is Nothing Then Exit sub
Set endDate = item.DateTimeValue
Call endDate.SetAnyTime
Set item.DateTimeValue = endDate

Set item = doc.GetFirstItem( "StartTime" )
If item Is Nothing Then Set item = doc.ReplaceItemValue( "StartTime", startTime.LSLocalTime )
Set item.DateTimeValue = startTime

Set item = doc.GetFirstItem( "EndTime" )
If item Is Nothing Then Set item = doc.ReplaceItemValue( "EndTime", endTime.LSLocalTime )
Set item.DateTimeValue = endTime

Set startDateTime = New NotesDateTime( startDate.DateOnly & " " & startTime.TimeOnly )
Call startDateTime.SetAnyTime
Set item = doc.GetFirstItem( "StartDateTime" )
If item Is Nothing Then Set item = doc.ReplaceItemValue( "StartDateTime", startDateTime.LSLocalTime )
Set item.DateTimeValue = startDateTime

Set endtDateTime = New NotesDateTime( endDate.DateOnly & " " & endTime.TimeOnly )
Call endDateTime.SetAnyTime
Set item = doc.GetFirstItem( "EndDateTime" )
If item Is Nothing Then Set item = doc.ReplaceItemValue( "EndDateTime", endDateTime.LSLocalTime )
Set item.DateTimeValue = endDateTime

Set item = doc.GetFirstItem( "CalendarDateTime" )
If item Is Nothing Then Set item = doc.ReplaceItemValue( "CalendarDateTime", startDateTime.LSLocalTime )
Set item.DateTimeValue = startDateTime

xx = 0
Redim tempDates(xx) As Variant
Do While endDateTime.TimeDifference( startDateTime ) >= 0
Redim Preserve tempDates(xx)
tempDates(xx) = Cdat( startDateTime.DateOnly )
xx = xx + 1
startDateTime.AdjustDay( 1 )
Loop
If Ubound( tempDates ) > 0 Then item.Values = tempDates

End sub

After running the agent I can see the document properties in the calendar view, and I can see the StartDate field with the correct date value in the field, and I can see the CalendarDateTime field with the incorrect date values in the field: it has "00:00:00 ZW3" time stamp on each date.
Am I missing something? I don't think so. Why wouldn't this show on the calendar the right way if i set the start date, end date, and calendar date time?
Any help would be appreciated.

Thanks
Paulo






Create all day event programattical... (PauloSergio Sil... 12.Apr.06)
. . RE: Create all day event programatt... (Andrei Kouvchin... 12.Apr.06)
. . . . RE: Create all day event programatt... (PauloSergio Sil... 12.Apr.06)
. . . . . . RE: Create all day event programatt... (Leandro Giardil... 6.Jul.06)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite