Show the same document in a view with different forms
This tip describes how to 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."



Download: IT Certifications 101
Inside this exclusive essential guide, our independent experts break down which IT certifications are worth your time and effort, and how to get started obtaining them to further your career— including specific certifications that any cloud or desktop pro should seriously consider.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.
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.
- 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.
- 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")
- 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.
Start the conversation
0 comments