Home > Domino Tips > Developer > LotusScript > Deleting 'Private on first use' views/folders
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Deleting 'Private on first use' views/folders


Bryce Berry
10.24.2003
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

As has been previously posted, there's a bug in ND6 when using the GetView method of the NotesDatabase class to get a handle on POFU views/folders. This post in Lotus.com's ND6 forum and the Using method or property of NotesView object returns error: "Index is not to be generated on server" technote document this problem.

Through testing I have found that once a private view/folder has been created by accessing the shared one, formula commands such as and Script such as are using the private one, so putting docs into a POFU view/folder and removing them should not be a problem.

On the other hand, you might want to delete private views/folders automatically when a user exits the database so they are cleaned up. In R5 the GetView method would grab the private view/folder instead of the shared one, so if you wanted to delete the private one, it was easy. With the bug in ND6, others have posted workarounds (see this post to Lotus' ND6 forum) to loop through all of the views and find the matching one that has something in the Readers field. The problem with this is if the database has quite a few views or folders, it can take forever to loop through them all when the user leaves the database.

To make up for the bug, I wrote some script using Notes API calls to grab the private view by name, get its NoteID, get it as a document using the NotesID and then delete it. The code below goes into the database script. Some of the documentation is directly from the Lotus C API reference.

NOTE: I deleted my error handling routine to send e-ma...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
LotusScript
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
LotusScript filters and attaches files to a Notes form

LotusScript
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


ils or edit the agent log, but I would definitely suggest you add your own.

Hope this might help someone. If anyone sees a problem with it or places it could be improved, please let me know. And then in the QueryClose event, I just pass the database and view/folder name. Again, add your own errorhandling.

MEMBER FEEDBACK TO THIS TIP

I found that this code works fine if you work with "Shared, private on first use." But if you use "Shared, desktop private on first use," the API does not find the view and it does not work. Is there a way, using Notes R6.51, to delete in the querysave the view that is stored in the desktop?

— Adriana D.

******************************************

I checked the API documentation, and here is what it states for the NIFFindPrivateDesignNote function (which is what I'm using):

"Specify NOTE_CLASS_VIEW for private folders as well as private views. However, private folders that are stored in the user's desktop file, rather than in the database, cannot be accessed by the C API. Also, the C API cannot store private folders in the user's desktop file. Private folders are stored in the user's desktop file only by the Notes user interface and only if the user does not have the access right to create private folders in the database."

A couple of things to note:

  • The regression error that was introduced in R6 that forced me to write the code to delete private views/folders has apparently been corrected in 6.0.4/6.5.2 for local databases. But, I can't confirm this. See SPR # TGOO5JVEGC.

    Apparently it has not been corrected for server databases (several posts on LDD r6 Forum).

  • The only way I know of to delete "Shared, desktop private on first use" views/folders is to delete the icon for the database from the desktop. At that point the user will be asked to confirm, and it will delete the number of private views/folders that are found. This could possibly be automated but I haven't done that.

—Bryce B.


Do you have comments of your own? Let us know.


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts