Dear Team,
I am developing one application in Xpages and using code ssjs.
My requirement is user login and create some documents like 'Appointment,Meeting and Reminder" but display in user mail box calendar not in a application.
Please guide me or provide me a suitable solutions.
I am using below code please check and suggest me where i am wrong or suggest me any alternate solutions.
var db:NotesDatabase = session.getCurrentDatabase();
var doc:NotesDocument =Edoc.getDocument();
var dt:NotesDateTime=session.createDateTime("Today");
var sdt:NotesDateTime=session.createDateTime(getComponent("inputText7").getValue());
var edt:NotesDateTime=session.createDateTime(getComponent("inputText6").getValue());
var sdtime:NotesDateTime=session.createDateTime(getComponent("mtgTime1").getValue());
var edtime:NotesDateTime=session.createDateTime(getComponent("mtgTime2").getValue());
//User Mail box calendar entry
var keyvalue=@Name("[Abbreviate]",@UserName());
var dbPath=@DbName()[1];
var dbname = new Array(@Subset(@DbName(), 1),"names.nsf");
var resultMailfile=@Unique(@DbLookup(dbname, "($VIMPeople)",keyvalue,"MailFile"))+".nsf";
(typeof resultMailfile == "string") ? "No result" :resultMailfile;
var server = session.getCommonUserName();
requestScope.msg=server+" || " +resultMailfile
var udb:NotesDatabase = session.getDatabase(server,resultMailfile,true)
var newDoc = udb.createDocument();
newDoc.appendItemValue("Form","Appointment");
newDoc.appendItemValue("SaveOptions","1");
newDoc.appendItemValue("AppointmentType",getComponent("comboBox1").getValue());
newDoc.appendItemValue("dispAppointmentType",getComponent("comboBox1").getValue());
newDoc.appendItemValue("tmpAppointmentType",getComponent("comboBox1").getValue());
newDoc.appendItemValue("Subject",getComponent("inputText3").getValue());
newDoc.appendItemValue("Chair",@Name("[Abbreviate]",@UserName()));
newDoc.appendItemValue("AltChair",getComponent("djextNameTextBox3").getValue());
newDoc.appendItemValue("Room",getComponent("inputText4").getValue());
newDoc.appendItemValue("RoomToReserve",getComponent("djextNameTextBox3").getValue());
newDoc.appendItemValue("Location",getComponent("inputText5").getValue());
newDoc.appendItemValue("StartDate",sdt.getDateOnly());
newDoc.appendItemValue("tmpStartDate1",sdt.getDateOnly());
newDoc.appendItemValue("EndDate",edt.getDateOnly());
newDoc.appendItemValue("tmpStartTime_Local",sdtime.getLocalTime());
newDoc.appendItemValue("CalendarDateTime",sdtime.getLocalTime());
newDoc.appendItemValue("StartTime",sdtime.getLocalTime());
newDoc.appendItemValue("EndTime",edtime.getLocalTime());
newDoc.appendItemValue("StartDateTime",edtime.getLocalTime());
newDoc.appendItemValue("EndDateTime",edtime.getLocalTime());
newDoc.appendItemValue("$PublicAccess", "1");
newDoc.save()
Thanks & Regards
Ajeet Kumar