Manage Learn to apply best practices and optimize your operations.

Views and $$Viewtemplate

We all know a form titled '$$ViewTemplateDefault' (containing a $$ViewBody field) will display all the views within a db in a browser.

A form titled '$$ViewTemplate for Contacts' will display the 'Contacts' view. What if you have lots of Contact views and you what to have only the one '$$ViewTemplate for Contacts' form?

Well give the same alias to all the Contacts views. i.e. 'Contactsby Company|Contacts'
'Contactsby Name|Contacts'
'Contactsby Account Manager|Contacts'
'Contactsby Mail Address|Contacts' etc.

They will all be displayed in a browser via the '$$ViewTemplate for Contacts' form and other views will use the '$$ViewTemplateDefault' form.

To display the view name on the Web page add a computed for display field to the form with the formula @ViewTitle. Note the functionality of @ViewTitle has change between R4 and R5. In R5 @ViewTitle returns a list of the view name and all aliases. Use @Subset to return the required element of the list.

Cheers Simon

Dig Deeper on Domino Resources

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...