This tip gives users an "almost private" view. This formula will take the user's cursor directly to any category when the view is opened, it will expand the category showing all documents, it will always display neatly at the top of the view and will do so dynamically for individual users. Especially good when used with a view categorized by @Name.
Instead of seeing a categorized view like this: > Andrew Bacon > Bert Newton > Isaac Asimov > James Joyce > John Smith the user Isaac Asimov would see the following and won't even notice the other documents - he will just see his name at the top of the view and all documents underneath: >Isaac Asimov document.. document.. document.. document.. document.. document.. document.. >James Joyce >John Smith Steps: 1. Build categorised view (one based on notes name works well). 2. Add formula below to the PostOpen even of the view. 3. Modify the 1st line of the formula to include the current view alias. This formula requires custom _viewName and _key values per view. Formula: REM " =================================================================== " ; REM " Go to users personal category and expand, if available. " ; REM " Categorise view by Common user name (or anything to match the *_key* below) " ; REM " Note: *_thisView* must contain the name/alias of the current view "; REM " and must be modified per view. " ; REM " ==================================================================== " ; _thisView := "XXXXXXXX" ; _key := @Name([CN];@UserName) ; _val := @DbLookup( "":"NoCache" ; "" ; _thisView ; _key ; 1 ) ; @Command([ViewCollapseAll]) ; @If( !@IsError( _val ) ; @PostedCommand( [OpenView] ; _thisView ; _key ) : @PostedCommand( [ViewExpand] ) ; "" )
This was first published in July 2002