setOption (NotesDatabase - JavaScript)

Sets the value of a database option.

Defined in

NotesDatabase

Syntax

setOption(option:int, flag:boolean) : void
Parameter Description
option One of the following:
  • NotesDatabase.DBOPT_LZCOMPRESSION 65 uses LZ1 compression for attachments
  • NotesDatabase.DBOPT_LZ1 65 uses LZ1 compression for attachments
  • NotesDatabase.DBOPT_MAINTAINLASTACCESSED 44 maintains LastAcessed property
  • NotesDatabase.DBOPT_MOREFIELDS 54 allows more fields in database
  • NotesDatabase.DBOPT_NOHEADLINEMONITORS 46 doesn't allow headline monitoring
  • NotesDatabase.DBOPT_NOOVERWRITE 36 doesn't overwrite free space
  • NotesDatabase.DBOPT_NORESPONSEINFO 38 doesn't support specialized response hierarchy
  • NotesDatabase.DBOPT_NOTRANSACTIONLOGGING 45 disables transaction logging
  • NotesDatabase.DBOPT_NOUNREAD 37 doesn't maintain unread marks
  • NotesDatabase.DBOPT_REPLICATEUNREADMARKSTOANY 71 replicates unread marks to all servers
  • NotesDatabase.DBOPT_OPTIMIZATION 41 enables document table bitmap optimization
  • NotesDatabase.DBOPT_REPLICATEUNREADMARKSTOCLUSTER 70 replicates unread marks to clustered servers only
  • NotesDatabase.DBOPT_SOFTDELETE 49 allows soft deletions
flag
  • true to enable the option
  • false to disable the option

Usage

Compact the database to ensure that the option takes effect. See compact.

See getOption for getting a database option.

Setting DBOPT_REPLICATEUNREADMARKSTOANY true also sets DBOPT_REPLICATEUNREADMARKSTOCLUSTER true. Setting DBOPT_REPLICATEUNREADMARKSTOCLUSTER true sets DBOPT_REPLICATEUNREADMARKSTOANY false. Setting both options false means unread marks are never replicated.

The database must be open. Otherwise an exception occurs.

Examples

This button toggles the soft delete option.
if (database.getOption(NotesDatabase.DBOPT_SOFTDELETE)) {
	database.setOption(NotesDatabase.DBOPT_SOFTDELETE, false);
	requestScope.status = "Soft deletes turned off";
} else {
	database.setOption(NotesDatabase.DBOPT_SOFTDELETE, true);
	requestScope.status = "Soft deletes turned on";
}