IBM Support

Is there a way to programmatically change Database Properties for a database?

Technote (FAQ)


Question

Is there a way to programmatically change Database Properties for a Lotus Notes/Domino database?

The NotesDatabase class has GetOption and SetOption methods to access a number of database properties, such as using LZ1 compression or maintaining the Last Accessed property. Refer to the Lotus Domino Designer Online Help for full details of the available properties.

If you want to modify other properties, you can do so by modifying the $Flags value in the database icon. NOTE: Be careful, modifying the database icon incorrectly can damage the database.

The details that follow are provided for information only, should be used as is, and at your own risk. Product Support cannot assist with resolving problems caused by setting the values incorrectly.


Answer

Many of the Database Properties settings are stored in the icon design element's $Flags item. LotusScript can easily get a handle to the icon design element using the hardcoded ID value, FFFF0010.

NOTE: Some of the code values for $Flags require that additional fields be set.

The following code snippet is an example that gets a handle to the icon design element, updates the $Flags item, and saves the icon design element:

    Set doc = db.GetDocumentByID("FFFF0010")
    doc.~$Flags = doc.~$Flags(0) & "x"
    'Where x is value you want to add
    call doc.Save (True, False)

The content below details the majority of Database Properties that are recorded in the $Flags item in the icon design element. Note that not all database property settings are recorded in the $Flags item.

Basics tab
J = Use JavaScript when generating pages.
X = Require SSL Connection.
8 = Don't allow a URL to open.
f = (disables) Allows use of Stored Forms in this database. Remove "f" to enable the setting.
i = Display images after loading. Note: Makes database inaccessible to Notes 4.6 and earlier.
5 = Allow document locking.
g = Type: Library.
j = Type: Personal Journal.
b = Type: Domino Directory.
B = Type: Directory Catalog.
m = Type: Multi DB Search.
u = Type: Portfolio.
A = Type: Mailbox.
r = Type: MailFile.

Advanced tab
2 = Optimize document table bitmap.
z = Don't maintain unread marks.
Q = Replicate Unread Marks: Clustered Servers Only. Note: $FlagsNoRefresh should also be set to include Q and remove "v" if present.
QU = Replicate Unread Marks: All Servers. Note: $FlagsNoRefresh should also be set to include QU and remove "v" if present.
(neither Q or QU) = Replicate Unread Marks: Never. Note: $FlagsNoRefresh should also be set to include "v" and remove Q or U if present.
3 = Maintain LastAccessed property.
1 = Don't support specialized response hierarchy.
Z = Use LZ1 compression for attachments.
7 = Allow more fields in database (expanded UNK Table).
4 = Allow soft deletes.
    The following Advanced tab settings were introduced in Notes 8.0:
q = Compress database design.
N = Compress document data.
H = Support response thread history.
-C = Copy-style compaction.
-N = Disable "Compress database design" database property. Use -C with -N to uncompress current database design documents.
-n = Enable "Compress database design" database property. Use -C with -n to compress current database design documents.
-V = Disable "Compress document data" database property. Use -C with -V to uncompress current document data.
-v = Enable "Compress document data" database property. Use -C with -v to compress current document data.

Launch tab
n = disables Show "About Database" document when database is opened for first time. Note: Must remove "c" if present from $Flags.
c = Show "About Database" document if modified AND Show "About database" document when database is opened for first time. Note: Must remove "n" if present from $Flags.
F = When opened in Notes: Open designated Frameset. Note: Requires $DefaultFrameset be set to desired frameset.
l = When opened in Notes: Launch designated navigator. Note: Requires $DefaultNavigator be set to desired navigator.
ls = When opened in Notes: Launch designated navigator in its own window. Note: Requires $DefaultNavigator be set to desired navigator.
p = When opened in Notes: Open "About Database" document.
a = When opened in Notes: Launch first attachment in "About database".
d = When opened in Notes: Launch first doclink "About database". Note: The options "a", "d", "p" above can also be set with K to additionally enable "Restore as lasted viewed by user".
P = When opened in a browser: Open "About database" document.
S = When opened in a browser: Open designated frameset. Note: Requires $DefaultWebFrameset be set to desired frameset.
E = When opened in a browser: Open designated page. Note: Requires $DefaultWebLaunchPage be set to desired page.
L = When opened in a browser: Open designated navigator in its own window. Note: Requires $DefaultWebNavigator be set to desired navigator.
D = When opened in a browser: Launch first doclink "About database".
T = When opened in a browser: Open designated docLink. Note: Requires setting $LaunchWebDoclink field to the doclink value. The field must be of the DocLink type Reference List. This field value should be created manually via the user interface.
V = When opened in a browser: Launch first document in view. Note: Requires setting $LaunchWebViewName to the desired view name.
w = Preview pane default: Bottom right.
x = Preview pane default: Right.
Note: When neither "w" or "x" is specified, the Preview pane default is Bottom.
y = Maximize document preview on database open. Note: May be used alone or combined enabled with w or x.

Design tab
6 = Allow design locking.
h = Mark parent document on reply or forward.
G = Copy profile documents with design. Note: Database must be specified as a template and have an .ntf extension.
M = Multilingual database. Note: Requires additional settings: Requires $DefaultLanguage be set to default language/default region value. Optional: $DefaultCollation to set default sort order. Optional: $CollationType set to "@UCA" to additionally enable Unicode standard sorting.

Document information

More support for: IBM Domino Designer

Software version: 6.0, 6.5, 7.0, 8.0, 8.5, 9.0

Operating system(s): Windows

Reference #: 1244071

Modified date: 04 March 2010


Translate this page: