Help on calendar entry

I’m using a form in a call logging db I’ve created from which the person logging the call can book an Appointment into his/her calendar. Now I would like to make some changes, so the person logging the call could select a person (person X) in a dialog list field and create the Appointment into the calendar of person X.I’ve tried a couple of things, but get stuck everytime. This is the code I use to create the appointment into their own calendar. What needs to be changed to log into person X’s calendar?


Sub Click(Source As Button)

Dim session As New NotesSession 

Dim db As New NotesDatabase ("","")

Dim ws As New NotesUIWorkspace

Dim thisUIdoc As NotesUIDocument

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument 

Dim userName As New notesname(session.username)

Dim dbfilename As String

Dim dbserver As String

Dim value As Integer



Call db.OpenMail 

dbfilename=db.filepath 

dbserver = db.server





Set thisUIdoc = ws.CurrentDocument





subject1 = thisUIdoc.FieldGetText("bookingtype")

subject2 = thisUIdoc.FieldGetText("bookingstatus")

subject3 = thisUIdoc.FieldGetText("Serial")

subject4 = thisUIdoc.FieldGetText("Customer")



location1 = thisUIdoc.FieldGetText("Customer")

location2 = thisUIdoc.FieldGetText("Name")

location3 = thisUIdoc.FieldGetText("Address")

location4 = thisUIdoc.FieldGetText("City")

location5 = thisUIdoc.FieldGetText("Country")



todaydate = thisUIdoc.FieldGetText("Now")



Set uidoc = ws.ComposeDocument (dbserver,dbfilename,"Appointment")



Call uidoc.FieldClear("AppointmentType")

Call uidoc.FieldSetText("AppointmentType","0")

Call uidoc.Refresh

Call uidoc.FieldSetText("Subject",subject1 + " -- " + subject2+ " -- " +subject3+ " -- " +subject4)

Call uidoc.FieldSetText("Location",location1+ ",  " + location2 +" -- " +location3+ " -- " +location4+ " -- " +location5)

Call uidoc.FieldsetText("StartTime","08:00:00 AM")

Call uidoc.FieldsetText("EndTime","06:00:00 PM")

Call uidoc.FieldsetText("StartDate",todaydate)

Call uidoc.FieldsetText("EndDate",todaydate)

End Sub

Subject: help on calendar entry

Does the user invoking the agent have the rights to create an entry in person X’s calendar? if not, maybe you need to have the agent running on behalf of an entity that does.

Subject: RE: help on calendar entry

Within 1 team all calendars are open to each other so this should be no problem

Subject: RE: help on calendar entry

Assuming the user who presses the button has access to add to the other person’s calendar, you would need to locate the mail file of the target user. This could be done using @NameLookup via Evaluate, or by programming the address book view lookup yourself in LotusScript. In the latter case, remember there may be multiple directories; use AddressBooks property to get the list. To see what fields contain the mail server and filepath, find a person document and look at its properties from a view.

Once you have the server and filepath, proceed as you are now doing.