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


Milos Beograd 11.Apr.08 12:46 PM a Web browser
Notes Client 6.5.5 Windows XP


I have a client database and I am trying to set a reminder for client next call.
In contact records there are two date/time fields - NextCall (date) and CallTime (time). There is a button "Remind me" with the action below.
I do not get any errors but nither the calendar entry is created nor the document is placed in Alarm folder.

Any idea why this doesn't work?

Thanks!

Sub Click(Source As Button)
Dim s As NotesSession
Dim uiw As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim mailnote As NotesDocument
Dim mailDB As New NotesDatabase("","")
Dim thisDB As NotesDatabase
Dim dateitem As NotesItem
Dim timeitem As NotesItem
Dim success As Variant
Dim profile As NotesDocument

Set s=New NotesSession
Set uiw=New NotesUIWorkspace
Set uidoc=uiw.CurrentDocument
Set thisDB = s.CurrentDatabase
Set doc = uidoc.Document
Set mailDB = New NotesDatabase ("","")
mailDB.OpenMail
Set profile = mailDB.GetProfileDocument("CalendarProfile") 'find users calendar profile
If profile.EnableAlarms(0) < "1" Then ' check to see if alarms are enabled
Dim boxType As Long
boxType& = MB_YESNO + MB_ICONQUESTION
If Messagebox("You have not enabled alarms in your Calendar Profile. Do you want to enable them now?", boxType&, "Enable Alarms?") = 6 Then
uiw.EnableAlarms(True)
Call profile.ReplaceItemValue("EnableAlarms", "1")
Call profile.Save(True,True,True)
End If
End If
Set mailnote = New NotesDocument(mailDB)
mailnote.Form="Appointment"
mailnote.AppointmentType="4" 'reminder
mailnote.Subject="Reminder - Call" + " " +doc.first_name(0)+" "+doc.last_name(0)+" - "+doc.company(0)
mailnote.StartDate=doc.NextCall(0)
mailnote.StartTime=doc.CallTime(0)
mailnote.ExcludeFromView="D" 'ensures it doesn't appear in drafts view
mailnote.RemoveItem("$AlarmOffset")

Set dateitem = doc.GetFirstItem("NextCall")
Set timeitem = doc.GetFirstItem("CallTime")

Set AlarmTime = New NotesDateTime(dateitem.DateTimeValue.DateOnly & " " & timeitem.DateTimeValue.TimeOnly)
Call mailnote.ReplaceItemValue("$AlarmTime", AlarmTime.LSLocalTime)
Call mailnote.ReplaceItemValue("$NoPurge", AlarmTime.LSLocalTime)
Call mailnote.ReplaceItemValue("$AlarmDescription" , mailnote.Subject)
mailnote.StartDateTime=AlarmTime.LSLocalTime
mailnote.ReminderTime=AlarmTime.LSLocalTime
mailnote.EndDateTime=AlarmTime.LSLocalTime
mailnote.CalendarDateTime=AlarmTime.LSLocalTime
mailnote.BookFreeTime="1"
mailnote.CHAIR=s.UserName
mailnote.ORGDONTDOUBLEBOOK=""
mailnote.ORGTABLE="C0"
mailnote.PRINCIPAL=s.UserName
mailnote.tmpApptFlags=""
Call mailnote.ReplaceItemValue("_ViewIcon" , 10)
Call mailnote.ReplaceItemValue("$Alarm" , 1)
Call mailnote.ReplaceItemValue("$BusyPriority" , "2")
Call mailnote.ReplaceItemValue("$PublicAccess" , "1")
Call mailnote.ReplaceItemValue("$BusyName" , s.UserName)
Call mailnote.ReplaceItemValue("$PrevBusyName" , s.UserName)
success=mailnote.ComputeWithForm(False, False)
If success Then
Call mailnote.Save(False, False)
Call mailnote.PutInFolder("$Alarms") 'needs to be in this folder to allow the alarms agent to run on it
End If
Call uidoc.Refresh
Print "Calendar alarm created....."
Dim msg As String
msg = "Alarm Created for " & AlarmTime.LSLocalTime
Messagebox msg, MB_OK, "Calendar"

End Sub






Reminder Alarm notification doesn't... (Milos Beograd 11.Apr.08)
. . RE: Reminder Alarm notification doe... (Andrei Kouvchin... 13.Apr.08)
. . . . RE: Reminder Alarm notification doe... (Milos Beograd 14.Apr.08)
. . . . . . RE: Reminder Alarm notification doe... (Andrei Kouvchin... 27.Apr.08)





  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