Subject: RE: Assigning an array to a field
Take a look at the document properties for both a document created manually and one created via your script (without opening it). It will show you the field differences and the values that should be in there. This saves you having to open and save the documents manually to get them to compute.
Here is what I do to create a reminder via an agent (this creates a reminder and sets the notification alarm to trigger one day before scheduled. May be overkill, but I feel better about it):
Set doc2 = dbMail.createdocument
doc2.Form = “Appointment”
doc2.From = strUser
doc2.Chair = strUser
doc2.AltChair = strUser
doc2.Principal = strUser
doc2.AppointmentType = “4”
doc2.Subject = strSubject
doc2.Categories = strCategory
doc2.ScheduleSwitcher = “1”
doc2.OrgTable=“C0”
doc2.StartDateTime =Cdat(apptdatetime)
doc2.StartDate = Cdat(appt_date)
doc2.EndDateTime = Cdat(apptenddatetime)
doc2.EndDate = Cdat(appt_date)
doc2.StartTime = Cdat(appt_time)
doc2.EndTime = Cdat(appt_time)
doc2.~_ViewIcon = 10
doc2.CalendarDateTime = Cdat(apptdatetime)
Dim rtNote As NotesRichTextItem
set rtNote = New NotesRichTextItem (
doc2, “Body” )
Call rtNote.AppendText( “Click here to go to the reference document==>>” )
Call rtNote.AddTab( 1 )
Call rtNote.AppendDocLink (doc,“”)
Dim stringArray ( 1 To 2 ) As String
stringArray( 1 ) = “D”
stringArray( 2 ) = “A”
Call doc2.AppendItemValue
(“ExcludeFromView”,stringArray)
doc2.SequenceNum = 1
Call doc2.AppendItemValue(“$PublicAccess”,“1”)
Call doc2.AppendItemValue(“$Alarm”, 1)
Call doc2.AppendItemValue(“$AlarmDescription”,
strSubject)
Call doc2.AppendItemValue
(“$AlarmMemoOptions”, “2”)
Call doc2.AppendItemValue(“$AlarmOffset”, -1440)Call doc2.AppendItemValue(“$AlarmSendTo”,
strUser)
Call doc2.AppendItemValue
(“$AlarmSound”, “chord”)
Call doc2.AppendItemValue(“$AlarmUnit”, “D”)
Call doc2.AppendItemValue(“$AltPrincipal”,
strUser)
Call doc2.AppendItemValue(“Alarms”, “1”)
Call doc2.AppendItemValue
(“$BorderColor”, “D2DCDC”)
Call doc2.AppendItemValue(“$CSVersion”, “2”)
Dim strCSWISL (0 To 4) As String
strCSWISL(0)=“$S:1”
strCSWISL(1)=“$L:1”
strCSWISL(2)=“$B:1”
strCSWISL(3)=“$R:1”
strCSWISL(4)=“$E:1”
Dim itemCSWISL As NotesItem
Set itemCSWISL = New NotesItem (
doc2, “$CSWISL”, strCSWISL )
Call doc2.AppendItemValue(“$ExpandGroups”, “3”)
Call doc2.AppendItemValue
(“$FromPreferredLanguage”, “en-US”)
Call doc2.AppendItemValue(“$HFFlags”, “1”)
Call doc2.AppendItemValue(“$LangChair”, “”)
Call doc2.AppendItemValue(“$NoPurge”, Cdat
(apptdatetime))
Call doc2.AppendItemValue
(“$SMTPKeepNotesItem”, “1”)
Dim strWatched (0 To 4) As String
strWatched(0)=“$S”
strWatched(1)=“$L”
strWatched(2)=“$B”
strWatched(3)=“$R”
strWatched(4)=“$E”
Call doc2.AppendItemValue(“$WatchedItems”,
strWatched)
Call doc2.AppendItemValue(“$BusyName”, “”)
Call doc2.save(True,False)
Call doc2.PutInFolder(“$Alarms”, True)