pipalia
pipalia

Reputation: 911

Lotus Notes Two forms same document

Going back to the basics. I want to have two forms to view a document. But if document was created using Form A then always display Form A, if document was created using Form B then always display Form B when opening that document (but they must have the same alias and form name as far as the views are concerned). I don't want to change any of my current application logic, neither do I want to change my view formulas in order to have this Form B (form A already exists). Any help or tips would be appreciated.

Upvotes: 0

Views: 1646

Answers (3)

D.Bugger
D.Bugger

Reputation: 2359

You can add a Form Formula in your view. If could contain a simple formula like

@If(FormWasUsed="FormA"; "FormA"; "FormB")

or just plain

FormWasUsed

Upvotes: 2

David Navarre
David Navarre

Reputation: 1022

You can do this using computed subforms and hide-whens on fields and labels.

As Richard suggests, create two subforms that contain the labels and fields that are unique to "Form A" and "Form B". Make sure to have a "document type" field on the main form that indicates which subform will be used for that document. All common information goes on the main form, so that all documents appear in all the views and use the existing application logic.

If the different labels and fields are either non-contiguous or few in number, just add those fields with hide-when formulas based on the "document type" field.

You can't have two forms that have the same name and alias. You can have two forms with the same alias, but this is best used for forms that are available only to the Notes client or only to the Web client. Otherwise, the client won't know which form to use, since both are available -- I would suspect it would only use one, but that is not what you want.

Upvotes: 1

Richard Schwartz
Richard Schwartz

Reputation: 14628

I don't understand why you want to do this. It sounds to me like it's going to make your life really difficult in the long run. But, I guess you must have a reason, so here's what I would do:

  • Copy Form A into Subform A. At the bottom, add a Computed-When-Composed field OriginalForm, and set the value formula to "A".
  • Copy Form B into Subform B. At the bottom, add a Computed-When-Composed field OriginalForm, and set the value formula to "B".
  • Delete the original forms.
  • Make a new Form A with a Computed Subform, and set the formula to "Subform " + OriginalForm.
  • Make a new Form B with a Computed Subform, and set the formula to "Subform " + OriginalForm.

Upvotes: 2

Related Questions