IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Technical Library
developerWorks



[Back to Selectively replicating DOLS subscriptions: One customer's story]

LotusScript code for WebQuerySave event agent

Sub Initialize
On Error Goto ErrorHandler
Dim s As New NotesSession
Dim db As NotesDatabase, backenddb As NotesDatabase, nab As NotesDatabase
Dim note As NotesDocument, userdoc As NotesDocument
Dim backendview As NotesView, nabview As NotesView
Dim username As NotesName
Set note = s.DocumentContext
Set db = s.currentDatabase
lob$ = note.lob(0)
group$ = note.group(0)
div$ = note.division(0)
backendname$ = note.BackEndDBName(0)
'lookup the community home page in the backend db
Set backenddb = s.GetDatabase( db.server, backendname$, False)
If backenddb.isOpen Then
Set backendview = backenddb.getView("LOBHomePages")
If Not(backendview Is Nothing) Then
Set commdoc = backendview.getDocumentByKey(lob$ & "-" & group$ & "-" & div$, True)
If Not(commdoc Is Nothing) Then
homepage$ = commdoc.homepage(0)
'now write the homepage value to the nab for this user
Set nab = s.getdatabase("", "names.nsf", False)
Set nabview = nab.getView("($VIMPeople)")
Set username = New NotesName(note.ProfileName(0))
Set userdoc = nabview.GetDocumentByKey( username.Abbreviated, True)
If Not(userdoc Is Nothing) Then
userdoc.KNV2Home = homepage$
‘save the person doc
Call userdoc.save(True, False)
End If
End If
End If
End If
'let the profile doc save by doing nothing
Exit Sub

ErrorHandler:
Messagebox("Error in WriteCommunityToNab @ " & Erl & " error = " & Error)
Exit Sub
End Sub




    About IBM Privacy Contact