[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 878
  • Last Modified:

In Lotus Notes, how do I remove old calender profiles that show up when restarting

In Lotus Notes, how do I remove old calender profiles and old calender documents that keep showing up as process errors when restarting Lotus Notes?
It is not a problem issue but I am in the process of cleaning up a Lotus Notes mail system and that is one issue remaining.
0
rudolf35
Asked:
rudolf35
  • 4
1 Solution
 
SysExpertCommented:
also from IBM

Problem
Resolving problems sometimes requires you to delete profile documents. For example, a corrupt Calendar Profile document in a mail database can cause a Notes workstation crash when creating a Calendar entry. Such crashes can be avoided only by deleting the Calendar profile and recreating it. If using Notes R4, there is also an additional Delegation Profile document which may need to be deleted as well.

But as profile documents do not appear in views and folders, how can profile documents be deleted?
 
 
Solution
A distinction can be made between two cases:

1. The Profile document can be accessed for Reading/Editing directly:

      If the administrator/user is in edit mode after calling up the document, the only actions to perform are to switch into read mode, pressing the DELETE key and the F9 key. The document gets deleted. This method will not work for profile documents created/edited via a Dialogbox, such as the Mail template's Calendar profile or it's Out of Office Profile.


2. The Profile document cannot be accessed directly, or can only be accessed via a Dialogbox:

      You can use the LotusScript GetProfileDocument method (of the NotesDatabase class) to get a handle to a profile document, and the Remove method (of the NotesDocument class) to delete the profile document. Because calling the GetProfileDocument method creates a profile document on the fly prior to deleting the document, you should first check to see if the document previously existed. This can be done using the IsNewNote property (of the NotesDocument class). If the property returns True, then the profile did not exist prior to the GetProfileDocument call and there is no need to delete it.

      Beginning with Notes R5, the GetProfileDocCollection method has been added. This allows you to get a collection of profile documents in a database, independent of the key name used when creating the profile document(s).

      Additionally, if you know the Note ID of a profile document, then the GetDocumentByID method (of the NotesDatabase class) can also be used to get a handle to a Profile document.

      When using the GetProfileDocument method, you need to pass the name of the profile. If the Form the profile is based on has an Alias name, then this should be passed as the name parameter. Profile documents also have an optional key parameter which will also need to be passed if it was originally created using such a key. If the key is unknown, then the GetProfileDocCollection method could be used instead of the GetProfileDocument method.

      The Calendar profile is named "CalendarProfile". The Notes R4 Delegation profile is "DelegationProfile". The Out of Office profile is "OutOfOfficeProfile". In Notes R5, the Archive properties are stored in a profile called "Archive Profile". The iNotes Web Access/Domino Web Access profile is "inotesprofile".



Example 1, Profile document name known:

      Dim s as New NotesSession
      Dim db as NotesDatabase
      Dim doc as NotesDocument
      Set db = s.currentdatabase
      Set doc = db.GetProfileDocument(<Name of desired profile goes here in quotes>)
      Call doc.Remove(True)


Example 2, Deleting the Calendar Profile from the current user's mail file:

      Dim session as new notessession
      dim db as notesdatabase
      dim doc as notesdocument

      'This line returns the name of the mailfile
      maildbinfo = Evaluate(|@MailDbName|)

      set db = session.getdatabase(maildbinfo(0), maildbinfo(1))
      set doc = db.getprofiledocument("CalendarProfile")
      If Not doc.isnewnote Then Call doc.remove(true)

      'This profile will only exist if using a R4 Mail template. Including the line in R5 will cause no harm.
      set doc = db.getprofiledocument("DelegationProfile")
      If Not doc.isnewnote Then Call doc.remove(true)



Example 3, Accessing Profile document by it's Note ID:

      Dim session as new notessession
      dim db as notesdatabase
      dim doc as notesdocument

      Set db = s.currentdatabase
      set doc = db.getdocumentbyid("000021CA")
      If Not doc is Nothing Then Call doc.remove(true)


Where 000021CA is the Note ID of the Calendar profile.

Supporting Information:

From the On Line Help:

Hide details for GetProfileDocument methodGetProfileDocument method

      Retrieves or creates a profile document.

      Defined in

      NotesDatabase

      Syntax

      Set notesDocument = notesDatabase.GetProfileDocument( profilename$ [ , username$] )

      Parameters

      profilename$

      String. The name or an alias of the profile document.

      username

      String. Optional. The user name (key) attached to the profile document.

      Return value

      notesDocument

      The profile document that matches the given name.

Hide details for GetProfileDocCollection methodGetProfileDocCollection method

      Given a profile name, returns a collection of profile documents that match the name.

      Note This method is new with Release 5.

      Defined in

      NotesDatabase

      Syntax

      Set notesDocumentCollection = notesDatabase.GetProfileDocCollection( profilename$ )

      Parameters

      profilename$

      String. The name of the profile document.

      Return value

      notesDocumentCollection

      The collection of profile documents that match the given name.


0
 
rudolf35Author Commented:
In the console view, when the LN server is restarted, I can see old accounts (that have been deleted) still generating a calender profile error. The accounts where deleted some time ago and I do not know where the calender profiles error would come from.
0
 
SysExpertCommented:
Very common, and I simply ignore them, since I know the source.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now