APPLICATION DESIGN
A form is stored in the database it was created in and used to display all associated documents. However, there may be times when you are mailing a document to a database that does not have the form that was used to create the document. In those cases you can designate the form to be stored with each document created from it. Storing the form with each document does consume more memory.
When a user opens a document, IBM® Lotus® Domino(TM) uses these rules to determine which form to use to display it:
Storing the form with each document allows the document to display correctly even in a database where the form is missing, renamed, or deleted. This feature uses more system memory and may require as much as 20 times more disk space. Note that if you change the form design, there is no easy way to update all of the stored copies of the form. In general, store a form in a document only under these conditions:
To store a form with each document
1. Open the form.
2. Choose Design - Form Properties.
3. Click the Form Info tab.
4. Select "Store form in document" and close the Form Properties box.
5. Open Application Properties. At the Basics tab, check "Allow use of stored forms in this database."
Overriding the stored form
When a form is stored in a document, the form name is stored in a hidden field called $Title. Additional information is stored in the $Info, $WindowTitle, and $Body fields. To use a different form to display the document, create an agent that deletes this stored form information and designates another form to display the document.
Shared fields and documents with stored forms
If the form contains a shared field, that field is converted to a singleuse field in the copy of the form that is stored in the document. This ensures that if a copy of the document is stored in a database that does not contain the shared field definition, the field can still be used. In the original form, the field is still defined as shared.
Form formulas
To override the default form selection, write a form formula for a particular view. For example, you can write a form formula that uses one form to display all fields when a user edits a document and a different form that re-sequences or omits fields when a user reads a document. Since form formulas apply only to a specific view, documents created in other views do not use the form formula.
Designating a default form for a database
1. Open the Form Properties box.
2. Click the Form Info tab.
3. Select "Default database form."
Alternatives to storing forms
As an alternative to storing the form in a document, you can use the LotusScript Send method to design a form you can mail along with a document. This ensures that the database will have the correct form to display the document but won't need to store the form with each document.
See Also