Remove a profile document - Bracke Blog

Remove a profile document

01/03/2007 11:25:59 PM | Cranford, NJ USA

I know this is a BS publication but I need to write. I have been asked by people over and over again "How do I delete a profile in the users mail file?"

Using my handy-dandy F1 keystroke:

    "Profile documents allow for quick data retrieval, because they are cached while the database that stores them is open. Profile documents are like other database documents except they are somewhat invisible -- they do not display in views and are not included in a document count for the database. Users create profile documents by using an action button or agent you design that uses LotusScript or the formula language. "

The average notes administrator will know profile documents from the mail files. Many times these finicky documents will corrupt. So instead of trying to fix it, delete it. Let the end users recreate the document...

Create an agent and paste this tiny code into it:


Sub Initialize

Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument

Set db = s.currentdatabase

'This will delete the Out of Office Profile.
Set doc = db.GetProfileDocument("outofofficeprofile")
Call doc.Remove(True)

'This will delete the Calendar Profile.
Set doc = db.GetProfileDocument("calendarprofile")
Call doc.Remove(True)


End Sub

The reason I am even documenting this is largely due to the Rules used in the Notes/Domino R6.5.1 mail template. Rules actually use the Calendar Profile to store important stuff regarding the Rules. If the rules become corrupt or god forbid the end user deletes the document (R6.5.1 issue, fixed in later releases) the rule will still work! Removing the Calendar Profile will remove rule details!

Another agent I like to use is one that can remove more than one profile document. I know the F1 gods told me that there is only one profile document, but what about those replication conflicts? How can you remove every single copy to the Calendar Profile document. Use the following code to guide you to euphoria:


Sub Initialize

'Remove every copy of the Calendar Profile
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument

Set db = s.currentdatabase

Set dc = db.GetProfileDocCollection
For x = 1 To dc.count
Set doc = dc.GetNthDocument ( x )
Call doc.Remove(True)
Next

End Sub

Well, I hope this simple documentation can help the administrator out that is banging his/her head against the wall because they cannot determine why the mail file is acting the strange.

Permalink | Domino Development | Comments (0)