Domino 9 und frühere Versionen > ND8: Administration & Userprobleme

RunOnServer, ganz komisches Problem

<< < (3/3)

ascabg:
Hallo,

Ich mag mich taeuschen, aber ich sehe in dem Code an keiner Stellen den Aufruf des Agenten mit einem Parameter-Dokument a la agent.Run(doc.NoteID) bzw.
agent.RunOnServer(doc.NoteID).

Hier wuerde ich doch erst einmal meine Nachforschungen nach dem Fehler ansetzen.


Andreas

botschi:
So läuft es jetzt ohne Fehler und das neue Passwort geht auch:


--- Code: ---Sub Postsave(Source As Notesuidocument)

Dim db As NotesDatabase
Dim s As New NotesSession
Dim doc As NotesDocument

Set doc = source.Document
Set db = s.CurrentDatabase

Dim agent As NotesAgent
' nur replizieren, wenn es eine veränderung am passwort gab
If passwort_alt <> doc.passwort(0) Then
Set agent = db.GetAgent("ag_kennwort")
Call agent.RunOnServer(doc.NoteID)
End If

End Sub
--- Ende Code ---

und der Agent

--- Code: ---Sub Initialize

Dim db As notesdatabase
Dim s As New NotesSession
Dim doc As NotesDocument
On Error Goto fehler
'#######
Dim agent As notesagent
Set agent = s.CurrentAgent
Set db = s.CurrentDatabase
Set doc = db.GetDocumentByID(agent.ParameterDocID)

If doc Is Nothing Then
Exit Sub
End If
Print doc.UniversalID
'#######
Dim passwort As String
passwort = doc.passwort(0)

Dim adressdoc As NotesDocument
Dim adressdocview As NotesView
Dim adressbuch As NotesDatabase

Set adressbuch = s.GetDatabase(db.Server, "names.nsf")
Set adressdocview = adressbuch.GetView("(Person Common)")

Set adressdoc = adressdocview.GetDocumentByKey(doc.user(0), True)

If adressdoc Is Nothing Then
Exit Sub
End If
adressdoc.HTTPPassword = passwort

Call adressdoc.Save(True, False)
' Call adressbuch.Replicate( "Sametime2" )

Print "##### FERTIG ####"
Exit Sub

fehler:
Print "Fehler #" & Str(Err) & ": " & Error$ & " in Zeile " & Cstr(Erl)
Exit Sub
End Sub
--- Ende Code ---

Ich glaube, mein Code in der Maske war nicht richtig. Ich hatte im Postsave noch den alten Code drin, wo ich das Dok noch mit Werten füllen wollte- im Postsave natürlich blödsinn.

Hätte ich mal den ganzen Code posten sollen  ;D

Danke für eure Hllfe!

Matthias

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln