Hi, am new in this forum … and quite stuck with a prob … hope u guys can help.Here u go.
I’ve been assigned lately a work to created meeting in lotus notes via a webservice written in javascript …
Actually i managed to create the meeting but could really create a mail to prompt the user to cancel the meeting… am also posting my code i sed to create the meeting because i think the problem is in the creation of the meeting …a field value that i should have changed maybe
here’s my code(sorry its in french) to create the meeting…
public String creationCourierAvecInvitation(String dest, String suj, String StartDate,String NomClient, String LeSujet) {
String x = "\\\\abw_M3\\teste\\xx.txt";
System.out.println("creationCourierAvecInvitation ................test Start");
System.out.println("Fichier : " + suj);
System.out.println("Start Date : " + StartDate);
//System.out.println(dt);
try{
Session s = WebServiceBase.getCurrentSession();
//Session s = getSession();
Database db = s.getAgentContext().getCurrentDatabase();
Document doc = db.createDocument();
//DateTime dtnow = s.createDateTime("Today");
//DateTime dtTime = s.createDateTime("Today");
//DateTime dtEndTime = s.createDateTime("Today");
//dtTime.setNow();
//dtEndTime.setNow();
//dtEndTime.adjustHour(1,true);
DateTime dtnow = s.createDateTime(StartDate);
DateTime dtTime = s.createDateTime(StartDate);
DateTime dtEndTime = s.createDateTime(StartDate);
//dtTime.setNow();
//dtEndTime.setNow();
dtEndTime.adjustHour(1,true);
System.out.println(dtnow);
System.out.println(dtTime.getLocalTime());
System.out.println(dtEndTime.getLocalTime());
System.out.println(suj);
doc.replaceItemValue("Form", "Appointment");
doc.replaceItemValue("AppointmentType", "3");
doc.replaceItemValue("MeetingType", "1");
doc.replaceItemValue("Subject", "S4-" + NomClient + "-" + LeSujet);
doc.replaceItemValue("StartDate", dtnow);
//doc.replaceItemValue("CalendarDateTime", dtnow);
doc.replaceItemValue("StartDateTime", dtTime);
doc.replaceItemValue("tmpStartDate1", dtTime);
doc.replaceItemValue("StartTime", dtnow.getTimeOnly());
//doc.replaceItemValue("StartTimeZone", dtnow.getTimeZone());
doc.replaceItemValue("EndDateTime", dtEndTime);
doc.replaceItemValue("tmpEndTime1", dtEndTime);
doc.replaceItemValue("EndTime", dtEndTime.getTimeOnly());
doc.replaceItemValue("SendTo", dest);
doc.replaceItemValue("From", "Logiciel S4");
//doc.replaceItemValue("Author","Kevin Koman") ;
doc.replaceItemValue("Principal",dest) ;
doc.replaceItemValue("CopyTo", "");
doc.replaceItemValue("Chair", "");
//doc.replaceItemValue("sequencenum", 1);
doc.computeWithForm(true,false);
//Call doc.ComputeWithForm(True,False);
//doc.replaceItemValue("Subject", "Mail avec invitation");
//doc.replaceItemValue("SendTo", dest);
//doc.replaceItemValue("From", "Agenda S4");
RichTextItem body = doc.createRichTextItem("Body");
body.appendText("Fichier excel jointes");
body.addNewLine(2);
System.out.println(suj);
body.embedObject(EmbeddedObject.EMBED_ATTACHMENT,"", suj ,"");
doc.save(true, true);
doc.send();
}
code to cancel the meeting
…
public String creationCourierAvecInvitation(String dest, String suj, String StartDate,String NomClient, String LeSujet) {
String x = "\\\\abw_M3\\teste\\xx.txt";
System.out.println("creationCourierAvecInvitation ................test Start");
System.out.println("Fichier : " + suj);
System.out.println("Start Date : " + StartDate);
//System.out.println(dt);
try{
Session s = WebServiceBase.getCurrentSession();
//Session s = getSession();
Database db = s.getAgentContext().getCurrentDatabase();
Document doc = db.createDocument();
//DateTime dtnow = s.createDateTime("Today");
//DateTime dtTime = s.createDateTime("Today");
//DateTime dtEndTime = s.createDateTime("Today");
//dtTime.setNow();
//dtEndTime.setNow();
//dtEndTime.adjustHour(1,true);
DateTime dtnow = s.createDateTime(StartDate);
DateTime dtTime = s.createDateTime(StartDate);
DateTime dtEndTime = s.createDateTime(StartDate);
//dtTime.setNow();
//dtEndTime.setNow();
dtEndTime.adjustHour(1,true);
System.out.println(dtnow);
System.out.println(dtTime.getLocalTime());
System.out.println(dtEndTime.getLocalTime());
System.out.println(suj);
doc.replaceItemValue("Form", "Appointment");
doc.replaceItemValue("AppointmentType", "3");
doc.replaceItemValue("MeetingType", "1");
doc.replaceItemValue("Subject", "S4-" + NomClient + "-" + LeSujet);
doc.replaceItemValue("StartDate", dtnow);
//doc.replaceItemValue("CalendarDateTime", dtnow);
doc.replaceItemValue("StartDateTime", dtTime);
doc.replaceItemValue("tmpStartDate1", dtTime);
doc.replaceItemValue("StartTime", dtnow.getTimeOnly());
//doc.replaceItemValue("StartTimeZone", dtnow.getTimeZone());
doc.replaceItemValue("EndDateTime", dtEndTime);
doc.replaceItemValue("tmpEndTime1", dtEndTime);
doc.replaceItemValue("EndTime", dtEndTime.getTimeOnly());
doc.replaceItemValue("SendTo", dest);
doc.replaceItemValue("From", "Logiciel S4");
//doc.replaceItemValue("Author","Kevin Koman") ;
doc.replaceItemValue("Principal",dest) ;
doc.replaceItemValue("CopyTo", "");
doc.replaceItemValue("Chair", "");
//doc.replaceItemValue("sequencenum", 1);
doc.computeWithForm(true,false);
//Call doc.ComputeWithForm(True,False);
//doc.replaceItemValue("Subject", "Mail avec invitation");
//doc.replaceItemValue("SendTo", dest);
//doc.replaceItemValue("From", "Agenda S4");
RichTextItem body = doc.createRichTextItem("Body");
body.appendText("Fichier excel jointes");
body.addNewLine(2);
System.out.println(suj);
body.embedObject(EmbeddedObject.EMBED_ATTACHMENT,"", suj ,"");
doc.save(true, true);
doc.send();
}
I know its quite a mess but maybe my notes and comments might give u an idea wat i tried before
Thnx in adv.