当用户登录之后,我想创建一个链接,通过ServerSide Javascript访问XPage中的第一个用户邮件。当用户单击打开第一封邮件的链接时。
有没有办法让这项工作?
此致 Cumhur Ata
更新:
var mailDb:NotesDatabase = session.getDatabase(database.getServer(), mailFile);
var mailView:NotesView = mailDb.getView("($Inbox)");
var unreadEntries:NotesViewEntryCollection = mailView.getAllUnreadEntries();
if (unreadEntries.getCount()>0)
{
var veUnread:NotesViewEntry = unreadEntries.getFirstEntry();
var dt:NotesDateTime = veUnread.getDocument().getItemValueDateTimeArray("DeliveredDate").elementAt(0)
for (var i=0; i<unreadEntries.getCount() && i<3; i++)
{
//I can get field values. Find the DeliveredDate below..
var dt:NotesDateTime = veUnread.getDocument().getItemValueDateTimeArray("DeliveredDate").elementAt(0)
//I think Where I need to create DocLink is here but not succeded yet :(
var veUnread:NotesViewEntry = unreadEntries.getNextEntry(veUnread);
}
}
答案 0 :(得分:1)
让它变得更容易。只需构建@MailDbName
和/($Inbox)/$first
的网址即可打开收件箱中的第一个文档。有关详细信息,请参阅URL Command documentation