Manage Learn to apply best practices and optimize your operations.

Updates Personel Data In Nab From Another Database

Updates the general fields (phone, adress extra) in the Notes Address Book from
a Human Resource DB or any other DB.
Sub Querysave(Source As Notesuidocument, Continue As Variant)
Dim s As New NotesSession
Dim coll As NotesDocumentCollection
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim Item As NotesItem
Dim compare As NotesItem
Dim db As NotesDatabase
Dim db2 As NotesDatabase 'Current database
(HR)
Dim doc As NotesDocument
Dim doc2 As NotesDocument 'Current Form
Dim dateTime As New NotesDateTime( "" )

Set db2 = s.CurrentDatabase 'To Define The Server
Set db = New NotesDatabase ("server","names.nsf") 'Address Book on
server
'Set db = New NotesDatabase ("","testnames.nsf") local Adress
book

Set uidoc=workspace.CurrentDocument
Set doc2=uidoc.Document


sFirstName$ = doc2.FirstName(0)
sLastName$ = doc2.LastName(0)
'sStatus$ = doc2.Status(0)

If doc2.Status(0)<>"Active" Then
Exit Sub
End If

selection$ = "@If(Form = ""Person"" & FullName=""" + sFirstName$ & " " &
sLastName$ +""")"
Set coll = db.Search( selection$, dateTime, 1 )

Set doc = coll.GetFirstDocument

If (doc Is Nothing ) Then
Messagebox "Employee does not exist in Address Book !!!!"
Exit Sub
End If

'Updates Parameters from HR to the NAB:
' Group -> Dep.
' Manager -> Manager
' Job Title -> Job Title
' Location -> Location


Set item = doc2.GetFirstItem( "Group" )
Set compare = doc.GetFirstItem("Department")
If Not item.Contains( catagory ) Then
doc.Department=doc2.Group
Call doc.save(True,False)
End If

Set item = doc2.GetFirstItem( "JobTitle" )
Set compare = doc.GetFirstItem("JobTitle")
If Not item.Contains( catagory ) Then
doc.JobTitle=doc2.JobTitle
Call doc.save(True,False)
End If

Set item = doc2.GetFirstItem( "Manager" )
Set compare = doc.GetFirstItem("Manager")
If Not item.Contains( catagory ) Then
doc.Manager=doc2.Manager
Call doc.save(True,False)
End If

Set item = doc2.GetFirstItem( "Location" )
Set compare = doc.GetFirstItem("Location")
If Not item.Contains( catagory ) Then
doc.Location=doc2.Location
Call doc.save(True,False)
End If




End Sub

This was last published in November 2000

Dig Deeper on Domino Resources - Part 2

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