Manage Learn to apply best practices and optimize your operations.

Prevent warning message when editing R5 Agents In R4 Designer

If you once saved an agent using R5 designer everytime you try to open it using
an R4 client the following warning message is displayed:
"Lotus Notes: This design element has been modified by a later version of
Notes. Saving any changes could cause a loss of design information". While
this message should be taken serious by the programmer it nonetheless
can become annoying if you are sure that your agent will keep
working if you re-store it under R4. Unfortunately there is no built-in
way to prevent this message from appearing.
The following piece of code - written as an agent itself - removes the design
note's field responsible for this message.
Please be aware that this code uses undocumented features of Notes, so
precautions like backing up your original code should be taken.

Sub Initialize 
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++
' + Agent "Remove R5 designer warning"
' + sub Initialize
' + lm/edcom 25-APR-2001
' + ===================================================
' + This agent changes another agent from R5 to R4 design;
' + Since there is no other way (at least none that I know of) it loops
' + through all possible Note IDs from 0x0001 to 0xFFFF; if the agent 
' + isn't found within this range and misspelling can be excluded as a 
' + reason the range has to be redefined (resulting in longer
' + processing time !).
' + Once the agent to be changed is found the design note field
' + "$DesignerVersion" is removed. This field obviously was introduced
' + with R4, it isn't found in R4 and earlier agents (if an agent
' + has been created or saved in R5 its design note contains this field
' + with a value of "5")
' + 
' + USE THIS AGENT AT YOUR OWN RISK ! Be sure to make a
' + backup copy of the agent before manipulating it !!
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++      
     Dim sn As New NotesSession
     Dim thisdb As NotesDatabase
     Dim coll As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim agnt As NotesAgent
     Dim strTitle As String
     Dim strFlag As String
     Dim strL As String
     Dim strR As String
     Dim strNID As String
     Dim intSuccess As Integer
     Dim intPos As Integer
     Dim lngCnt As Long
     
     intSuccess = False  ' preset the SUCCESS flag
     Set thisdb = sn.CurrentDatabase
     strTitle = Ucase(Inputbox("Enter the agent's title: ", "CHANGE AGENT FLAGS"))
' looping Note IDs 0001 to FFFF
     For lngCnt = 1 To 65535
          strNID = Hex (lngCnt)
          Set doc = thisdb.GetDocumentByID (strNID)
' is there a document with this Note ID ?
          If Not doc Is Nothing Then
' if doc has an item "$AssistFlags" it must be an agent's design note
               If doc.HasItem ("$AssistFlags") Then
' does the design note belong to our agent ?
                    If Ucase(doc.GetItemValue("$TITLE") (0)) = strTitle Then
' if doc has an item called "$DesignerVersion" it will display the warning message under R4
                         If doc.HasItem ("$DesignerVersion") Then
                              Call doc.RemoveItem ("$DesignerVersion")
                              Call doc.Save (True, True)
                         End If
' set the SUCCESS flag for a final message
                         intSuccess = True
                         Exit For  ' no further looping necessary
                    End If ' UCASE($TITLE)...
               End If  ' HasItem($AssistFlags)
          End If  ' not doc is nothing
     Next
     If intSuccess Then
          Msgbox "The agent " & strTitle & " won't tell you any longer that it 
was modified by a later version of Notes.", _ 64, "AGENT FLAGS CHANGED" Else Msgbox "An agent named " & strTitle & " could not be found",
64, "AGENT FLAGS NOT CHANGED" End If End Sub

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close