openIfModified (NotesDatabase - JavaScript)

Given a date, opens the specified database if it has been modified since that date.

Defined in

NotesDatabase

Syntax

openIfModified(server:string, dbfile:string, modifiedsince:NotesDateTime) : boolean
Parameter Description
server The name of the server on which the database resides. Use null to indicate a database on the current computer.
dbfile The file name of the database.
modifiedsince A cutoff date. If one or more documents in the database has been modified since this date, the database is opened; if not, it is not opened.
Return value Description
true indicates that the database was opened
false indicates that the database was not opened

Usage

Use Session.getDatabase(null, null) to instantiate an empty NotesDatabase object.

Examples

This button opens names.nsf only if was modified in the past hour.
var dt:NotesDateTime = session.createDateTime("Today");
dt.setNow();
dt.adjustHour(-1);
var db:NotesDatabase = session.getDatabase("", "");
if (db.openIfModified(null, "names", dt)) {
	requestScope.status = "Names.nsf opened";
} else {
	requestScope.status = "Names.nsf not opened";
}