This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Apr 29, 2015, 5:56 AM
41 Posts

Calendar in user mail box

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags: Calendar
  • Replies: 2

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

 

May 4, 2015, 7:34 AM
41 Posts
Calendar in user mail box

Thanks David Leedy for quick response.

I have already used iNotes calendar in a application, but i need same


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal