Domino Code Fragment

Code Name*
Via LotusScript, Insert a Computed Subform Based on Preview Pane Status?
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.145.173.132
Description*
It is not possible to accomplish this completely in LotusScript, since LotusScript does not manipulate subforms. You must use of a formula in a computed subfield in addition to a LotusScript in the QueryOpen event of the form.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

A hidden text field must be added to the form. For this example, the fieldname "preview" will be used.

Use the QueryOpen event to set the value of the field ("preview", in this example):
This hidden field "preview" must be assigned a default value of either "yes" or "no" depending on which subform you want to display when composing a document. For example, if you want "subform2" to display when composing a document, the default value for the "preview" field would be "yes". If you want "subform1" to display, a default value of "no" would be used.

The formula in the computed subform is as follows:

When a document is double-clicked in the view: