In a Lotus Notes view, you can display calculated values provided they are not based on a predetermined setting (for example, profile values). You can do it by predetermined values in the displayed documents only.
But if you have a horizontal application, and you need to enable a user to categorize the view to a special combination of data that differs from other users' wishes, then you have to allow for each user's specific view design requirements.
To satisfy this dynamic display in a view without redesigning the view for each user, do the following:
- Create a global preferences profile/document in the application.
- Create one or more checkbox fields to act as a controller to the required different settings for the display in the view.
- In the forms used to create the displayed documents, add the same fields as computed text fields and inherit their values from the preferences profile/document using the following formula: @GetProfileField("Global"; @ThisName). If you were using a preferences document, you can use the (@DbLookup function).
When you change the setting in the preferences profile, check for any change in the post-save event, and then prompt the user for the changes. If the changes were not accepted by the user, reset the settings to their original values. To apply and fix the changes, get the required document collection, and then loop on the collection to supply the new settings to the documents.
Now, each existing document will have the new setting and will be displayed according to each user's wishes. As well, each newly created document will have the new setting.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Sirry Hboos. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.