Manage Learn to apply best practices and optimize your operations.

Get Users To Update Specific Fields in their Location Documents

There may be a time that you need to update the Home Server due to server migration.

However, all your Notes clients are installed in the local hard C: drive on your users' PC.

With this script embedded in a hotspot button in your memo sent out to all users, they will just have to click on it. It's all that simple!!!


Function UpdateAllLocationDocuments (session As NotesSession, strFieldName As String, _
                      strNewValue As String) As Integer
  %REM
  This function updates the specified field name with the specified new value in the
  location document in local address book.
  This function can be executed by any user.
  session - a Notes session
  strFieldName - the target field name in the location document
  strNewValue - the target new value for the target field
  %END REM
  Dim db_AddressBk As NotesDatabase
  Dim docCollection_AddressBk As NotesDocumentCollection
  Dim doc_AddressBk As NotesDocument
  Dim item_AddressBk As NotesItem
  Dim dateTime As New NotesDateTime ("1/1/1971")
  Dim i As Integer

  Set db_AddressBk = session.GetDatabase ("", "names.nsf")
  If db_AddressBk Is Nothing Then
    UpdateAllLocationDocuments = False
    Exit Function
  End If

searchFormula$ = "Form = ""Location"" "
Set docCollection_AddressBk = db_AddressBk.Search(searchFormula$, dateTime,0)

UpdateAllLocationDocuments = True
If docCollection_AddressBk.Count <> 0 Then
  For i=1 To docCollection_AddressBk.Count
    Set doc_AddressBk = docCollection_AddressBk.GetNthDocument(i)
    Set item_AddressBk = doc_AddressBk.GetFirstItem(strFieldName)
    If item_AddressBk Is Nothing Then
      UpdateAllLocationDocuments = False
      Exit Function
    End If
    item_AddressBk.Values = strNewValue
    doc_AddressBk.Save False, True 
    Next
  Else
    UpdateAllLocationDocuments = False
  End If 

Dig Deeper on Domino Resources - Part 4

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