Domino 9 und frühere Versionen > ND8: Entwicklung

neue Dokumente erstellen

(1/6) > >>

tooot:
Hallo,

ich möchte gerne einen Agenten schreiben der läuft wenn ein Dokument (Form1) erstellt oder geändert wird. Er soll ein neues Dokument erstellen (Form2). Ich habe keine Erfahrung mit LotusScript...

habe hier etwas versucht:

Sub Initialize
   Dim ws As New NotesUIWorkspace
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim view As NotesView
   Dim doc As NotesDocument
   Dim newdoc As NotesDocument
   
   Set db = session.CurrentDatabase
   Set view = db.GetView("View1")
   
   Set newdoc = New NotesDocument(db)
   newdoc.Form = "Form2" 
      
      newdoc.Feld2 = doc.FeldA
      newdoc.Feld3 = doc.FeldB
      newdoc.Feld4 = doc.FeldC
      newdoc.Feld5 = doc.FeldD
      
      
      Call newdoc.Save(True,True)
End Sub


ich komm nicht so recht weiter. Könntet Ihr mir bitte helfen?

Vielen Dank!

Klafu:
Bei was kommst du denn nicht genau weiter ?
Hast du schonmal in die Hilfe geguckt, bzw. die Forensuche verwendet ?

Kleines Beispiel aus der Designer hilfe:


--- Zitat ---This script creates a new document in the current database, sets its Form and Body items, and saves it. If a user opens the document in the user interface, Notes uses the Status form to display it (if a form by that name exists in the current database).
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument ( db )
doc.Form = "Status"
doc.Body = "Client meeting postponed."
Call doc.Save( True, True )
--- Ende Zitat ---


Chris

tooot:
Danke für die schnelle Antwort. Ich habe aber im Forum und in der Designer Hilfe gesucht. Habe auch einiges gefunden und viel versucht aber irgendwie bin ich über die fehler Meldung "object variable not set" nicht hinaus gekommen :-/...

Vielen Dank

Christoph

Klafu:
Ich tippe mal auf

      newdoc.Feld2 = doc.FeldA
      newdoc.Feld3 = doc.FeldB
      newdoc.Feld4 = doc.FeldC
      newdoc.Feld5 = doc.FeldD
      
was ist denn 'doc.FeldA' ?
Wo kommen die Daten her ?

Chris

koehlerbv:
1. Fragen konkret formulieren
2. Bei Fehlermeldungen aus LotusScript den Debugger anwerfen und die Zeile markieren, in der der Fehler auftritt - keiner hat hier einen besonderen Bock, selber zu suchen.

Dies sind Minimalanforderungen an solche Posts, und dann wird Dir auch viel schneller geholfen, Christoph!

Bernhard

PS: Chris hat natürlich die korrekte Stelle mit dem inkorrektem Codeteil genannt.

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln