Lately I’m having problems creating ToDos and Appointments from backend via Lotus Script, did anybody succeded in this? Tried to create documents from scratch - can’t pass Computewithform, did’t showed up in view.
Making copy of existing document didn’t help either.
Can аnyone help, please?
Subject: ToDo and Appointment from backend?
Dim s As NotesSession Dim Adb As notesdatabase
Dim maildb As notesdatabase
Dim view As notesview
Dim w As notesUiworkspace
Dim doc As notesdocument
Dim doct As notesdocument
Dim reg As New NotesRegistration
Dim uname As String
Dim retmailserver As String
Dim retmailfile As String
Dim nm As String
Set s =New NotesSession
nm=s.username
Set w=New NotesUIWorkspace
Set doc=w.currentdocument.document
Dim userName As New NotesName(nm)
uname=UserName.Abbreviated
t=s.currentdatabase.server
reg.RegistrationServer = s.currentdatabase.server
Call reg.GetUserInfo(uname, retmailserver, retmailfile)
Set MailDb=New NotesDatabase(retmailserver, retmailfile)
'Set tv=MailDb.GetView("Templates")
'Set tdoc=tv.GetFirstDocument
'Set doct = tdoc.CopyToDatabase(maildb)
set doct=maildb.CreateDocument
Call doct.replaceItemValue("Form","Appointment")
Call doct.replaceItemValue("OrdersIds",doc.OrderUNID(0))
Call doct.replaceItemValue("ReAssignMark","Yes")
Call doct.replaceItemValue("PersonUNID",doc.UniversalID)
Call doct.replaceItemValue("AppointmentType","0")
contacts =doc.getItemValue("FullName")(0) & "."
If doc.getItemValue("WorkPhone")(0) <> "" Then contacts = contacts & Chr(10) & "Work Phone: " & doc.getItemValue("WorkPhone")(0)
If doc.getItemValue("HomePhone")(0) <> "" Then contacts = contacts & Chr(10) & "Home Phone: " & doc.getItemValue("HomePhone")(0)
If doc.getItemValue("CellPhone")(0) <> "" Then contacts = contacts & Chr(10) & "Cell Phone: " & doc.getItemValue("CellPhone")(0)
Call doct.replaceItemValue("Subject", contacts)
Call doct.replaceItemValue("$AlarmUnit", "M")
Call doct.replaceItemValue("$Alarm", 1)
Call doct.replaceItemValue("$AlarmMemoOptions", "")
Call doct.replaceItemValue("$AlarmDescription", contacts)
Call doct.replaceItemValue("$AlarmOffset", -1)
Dim ndt As NotesDateTime
t=Cstr(Datevalue(Today))+" 13:15:00"
Set ndt = New NotesDateTime(t)
Dim ndt1 As NotesDateTime
t=Cstr(Datevalue(Today))+" 13:20:00"
Set ndt1 = New NotesDateTime(t)
Call doct.replaceItemValue("STARTDATETIME", ndt)
Call doct.replaceItemValue("StartTime", ndt.TimeOnly)
Call doct.replaceItemValue("EndTime", ndt1.TimeOnly)
Call doct.replaceItemValue("StartDate", ndt.DateOnly)
Call doct.replaceItemValue("EndDate", ndt1.DateOnly)
Call doct.replaceItemValue("StartTimeZone", "Z=-3$DO=1$DL=3 -1 1 10 -1 1$ZX=52$ZN=Russian")
Call doct.replaceItemValue("EndTimeZone", "Z=-3$DO=1$DL=3 -1 1 10 -1 1$ZX=52$ZN=Russian")
Call doct.replaceItemValue("CalendarDateTime", ndt)
Call doct.ComputeWithForm(True,False)
Call doct.Save(True,True)
Subject: ToDo and Appointment from backend?
Can you put your code please.
It will be easier to help you
Willette Jean-Michel