How to create a Lotus Notes appointment programmatically

346360 pts.
Tags:
Lotus Notes Calendar
LotusScript
I've been trying to create an appointment (Lotus Notes calendar entry) and send it to invitees automatically. But I'm running into some issues. First, the calendar entry doesn't appear on the calendar for the chair. I got around this by adding them as a required attendee manually but I need to know how to do it automatically. Second, the invitees can't confirm their invitation. Lotus Notes keeps says that it can't process the invite because it doesn't exist in their mail file. Here's my code in Java but I can also put it in LotusScript too.
import java.util.GregorianCalendar;

import lotus.domino.AgentBase;
import lotus.domino.Database;
import lotus.domino.Document;
import lotus.domino.Session;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

      try {
          Session s = getSession();
          Database db = s.getDatabase("server", "maildatabase.nsf", false);
          String user = s.getUserName();

          Document doc = db.createDocument();
          doc.replaceItemValue("Form", "Appointment");
          doc.replaceItemValue("AppointmentType", "3");
          doc.replaceItemValue("$PublicAccess", "1");

          doc.replaceItemValue("Subject", "New Meeting"); 
          doc.replaceItemValue("CALENDARDATETIME", s.createDateTime(new GregorianCalendar(2012, 7, 24, 9, 0)).getLocalTime());
          doc.replaceItemValue("Body", "an invitation");

          doc.replaceItemValue("StartDate", s.createDateTime("08/24/2012").getLocalTime());
          doc.replaceItemValue("EndDate", s.createDateTime("08/24/2012").getLocalTime());
          doc.replaceItemValue("StartTime", s.createDateTime("09:00:00 AM").getLocalTime());
          doc.replaceItemValue("EndTime", s.createDateTime("10:00:00 AM").getLocalTime());
          doc.replaceItemValue("StartDateTime", s.createDateTime(new GregorianCalendar(2012, 7, 24, 9, 0)));
          doc.replaceItemValue("EndDateTime", s.createDateTime(new GregorianCalendar(2012, 7, 24, 10, 0)));

          doc.replaceItemValue("RequiredAttendees", "Invitee/company");
          doc.appendItemValue("RequiredAttendees",user);

          doc.replaceItemValue("SendTo", "Invitee/company");
          doc.appendItemValue("SendTo",user);
          doc.replaceItemValue("EnterSendTo", "Invitee/company");
          doc.appendItemValue("EnterSendTo",user);
          doc.replaceItemValue("From", user);
          doc.replaceItemValue("Principal",user);
          doc.replaceItemValue("Chair", user); 
          doc.replaceItemValue("Location", "location test");


          doc.computeWithForm(true, false);
          doc.save(true,false,false);

          String sendTo = doc.getItemValueString("SendTo");
          doc.send(false, sendTo);

      } catch(Exception e) {
          System.out.print(e.getMessage());
       }
   }
}
Thanks!

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following