Try this alternative: 1. Create a view, categorizing it on the department (DepartmentCB) and save it. I would make a copy of the view you are trying to get to, now, or just insert a new column into the front of the view, categorized on the department, and save it.
2. Create a Page
3. Embed a view in the page (Create -> Embedded Element -> View)
4. Select the view you just created or modified from the dialog box and hit OK 5. Choose "Show Single Category" as the event.
6. Put your code here. I'd put either your @Environment (make sure it equals the name of one of the categories) or your @GetProfileField.
7. Save it. This will make it a Page, not technically a View. But you can, using an outline or navigator, make that fact completely transparent to the user. This works in Notes and the Web.
This was first published in August 2002