Tip

Show the same document in a view with different forms

I have documents that contain information on 4 different parties.

When displaying in a view, the first column is coded so that each document appears 4 times i.e. "Show multiple categories as separate documents."

The problem was, dependant on which row in the view was selected, the user wanted to display a different form e.g. If the 1st party was selected, they wanted to display a form showing only the 1st party details and so on...


A non-technical solution...

I could have used subforms or hide-whens etc but given that the 4 separate forms already existed and the large number of fields on each I used form formulas as follows.

  1. Use the view's QueryOpendocument event, which gives you a handle to a NotesUIView object. This object has the "caretcategory" property, which returns the value of the categorised column.
  2. Based on the value of "caretcategory" I was able to determine which form I needed to display and set an environment variable e.g. NotesSession.SetEnvironmentVar("DisplayForm" , "Form1")
  3. In the Form Formula for that view, retrieve the environment variable. e.g. @Environment("DisplayForm")

As the QueryOpenDocument even occurs first, the Form Formula can then work out which form to use.

Note: This also works in embedded views.

This was first published in May 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.