Domino 9 und frühere Versionen > Entwicklung
Call doc.FieldAppendText in script einbinden
seerow:
Hallo,
kurze Frage, ich habe vor einiger Zeit mal in diesen Forum ein tolles script gefunden,
welches ein Feld über die Ansicht mit einen Wert aus einer Picklist füllte.
Leider wird der Wert bei einen erneuten update überschrieben. Könnte man das mit der "Call doc.FieldAppendText"
Formel verhindern?
--- Code: ---Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim picklist As Variant
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
picklist = workspace.Pickliststrings(3, False,db.Server,db.FilePath,"sw_update", "Titel", "Eingabeaufforderung", 1)
Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
doc.sw_update_history = picklist
Call doc.Save(True,False)
Set doc = collection.GetNextDocument(doc)
Wend
End Sub
--- Ende Code ---
Glombi:
Das geht nicht, da es eine Metode für ein NotesUIDocument ist.
Du kannst aber aus dem Feld eine Mehrfachwert machen und dann mit
Dim item as NotesItem
... ... ...
Set item = doc.GetFirstItem( "sw_update_history" )
Call item.AppendToTextList( picklist )
arbeiten.
Andreas
seerow:
prima, hat gefunkst...
Danke
seerow:
Also ich glaube ich spinn...... >:(
Jetzt habe ich den code von meiner Entwicklungs DB in die produktions DB übernommen, und jetzt bringt es die Fehlermeldung
"Object Variable not exist"
seerow:
upps code vergessen ...
--- Code: ---Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim picklist As Variant
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
picklist = workspace.Pickliststrings(3, False,db.Server,db.FilePath,"sw_update", "Titel", "Eingabeaufforderung", 1)
Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
Set item = doc.GetFirstItem( "update" )
Call item.AppendToTextList( picklist )
Call doc.Save(True,False)
Set doc = collection.GetNextDocument(doc)
Wend
End Sub
--- Ende Code ---
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln