Tweak Thursday will be a regular feature in Maarga blog from today, that will give you simple codes and widgets that will help make your user experience better. Tweak Thursday codes are given by talented developers of Maarga Systems.

I have been working on the Intranet system of Maarga for the past few days and the challenge was to show an employee’s calendar events in Lotus notes in his intranet profile page. This scenario you may come across in your companies or in your client’s environment especially when you develop portals for the internal employees. It’s s SJSS tweak that can get you this operation done.

The code


var commonUserName = new String(@Name(“[CN]”,@UserName()));
var mailServer = new StringBuffer();
var mailFile = new StringBuffer();
var mailDomain = new StringBuffer();
var mailSystem = new StringBuffer();
var profile = new Vector();

var Reg:NotesRegistration = session.createRegistration();
Reg.getUserInfo(commonUserName, mailServer, mailFile, mailDomain, mailSystem, profile);
var MailFilePath = @ReplaceSubstring(mailFile,””,”/”);

var mailPath = MailFilePath + “.nsf”
try {
// gettting the MailServer Path from Config Documents
var serverName = @DbLookup(@DbName(),”vwConfig”,”MailServer”,2)

var mailDb:NotesDatabase = session.getDatabase(@Text(serverName),mailPath)

var inboxView:NotesView = mailDb.getView(“MeetingsOnMyCalendar”) //this will all entries from the calendar

var today:NotesDateTime = session.createDateTime(@Today())
var dateRange = session.createDateRange()
dateRange.setText(@Text(today.getDateOnly()) +” 12:00:00 AM – ” + @Text(today.getDateOnly())+” 11:59:59 PM”)
var documentCollection:NotesViewEntryCollection = inboxView.getAllEntriesByKey(dateRange);

var documentCollection1:NotesDocumentCollection = inboxView.getAllDocumentsByKey(dateRange);
var totalDocumentCount1:Integer =  documentCollection1.getCount();

var totalDocumentCount:Integer =  documentCollection.getCount();
var today:NotesDateTime = session.createDateTime(@Today())

var MeetingDetails=””;

return “No Meetings for the day”

var viewEntry:NotesViewEntry = documentCollection.getFirstEntry()
var newArr = new Array()

var document:NotesDocument = viewEntry.getDocument()

var MeetingDate:NotesDateTime = session.createDateTime(@Text(document.getItemValue(“StartDateTime”)[0]))
if(MeetingDate.getDateOnly()==today.getDateOnly()){ //This will get you the non-repeated entry – If need all entries need to try here
var temp = @Text(document.getItemValue(“StartTime”)) + ” – ” +@Text(document.getItemValue(“EndTime”))+”      “+@Text(document.getItemValue(“Subject”))+”#”
if(MeetingDetails == “”)

MeetingDetails = temp

MeetingDetails = MeetingDetails + temp



viewEntry = documentCollection.getNextEntry(viewEntry)
MeetingDetails =  “No Meeting for the day”

return MeetingDetails

//Handle the error page

Sample Screenshots

Download the code text file here