OpenNTF.org - Agent to fix Server conf. docs
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Agent to fix Server conf. docs when they are copied. 
Rating:
Not Rated Yet 
Contributor:
Bastian Wieczorek 
Category:
Lotusscript 
Type:
Administration 
Document Release:
1.0 
Notes Version:
R6.x, R7.x 
Last Modified:
26 Apr 2007 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
If you copy a server config doc. it can happen, that Mail rules from one Server Configuration document unexpectedly appear in other Server Configuration documents.


Why is this happening and how can I prevent it?
This type of behavior will happen when you copy a Server Configuration document to create a Server Configuration document for a different server. This is because of the way the CFGDOCUNID field is computed. This field is a computed when composed field that captures the UNID of the original Server Configuration document when it is first created.

With the attached Agent you can correct the CFGDOCUNID field. Simply add this agent to your Server adressbook. Select the conf. doc. you wish to fix and run this agent.

ATTENTION:
You should remove existing rules for the server conf. doc or these rules will be lost. The reason for this is, that they are connected with the CFGDOCUNID from the server conf. doc. and this CFGDOCUNID field should be normaly the UNID.

Usage / Example
Sub Initialize
Dim nS As New NotesSession
Dim nDC As NotesDocumentCollection
Set nDC = nS.currentDatabase.UnprocessedDocuments
If nDC.Count <= 0 Then
Print "No documents selected."
Exit Sub
End If

Dim nD As NotesDocument
Set nD = nDC.getFirstDocument
While Not nD Is Nothing
Call nD.replaceItemValue("CFGDOCUNID",nD.UniversalId)
Call nD.save(True, False, True)
Set nD = nDC.getNextDocument(nD)
Wend

End Sub
Code Attachments
agent.txt (0 Kbytes)
 Comments

No documents found

 Add your comment!