Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Gandalf am 26.05.03 - 14:23:56

Titel: Agent - öffnen und wieder speichern
Beitrag von: Gandalf am 26.05.03 - 14:23:56
Hallo,

hab mittlerweile nen Brett vor dem Kopf und seh nur noch notes notes notes

Hilfe - ich brauche einen Agenten der markierte Dokumente öffnet und einfach wieder abspeichert.
Kann mir da jemand helfen  ???

Wäre klasse
Bye
Gandalf in Nöten
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: MrMagoo am 26.05.03 - 14:29:32
als @Befehl in einen Agenten schreiben:

@Command([ToolsRefreshAllDocs])

Gruß
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: Gandalf am 26.05.03 - 14:42:59
Hi MrMagoo,

läuft wunderbar mit der Einstellung "einmal ausführen"
läuft aber nicht bei "Ausgewählten Dokumenten"
die Einstellung lässt den @Befehl nicht zu.

Bitte bitte noch einmal helfen

Bye
Gandalf
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: MrMagoo am 26.05.03 - 14:54:31
fürs BackEnd müsste dieser hier laufen
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim collection As NotesDocumentCollection
   Dim doc As NotesDocument
   
   Set db = session.CurrentDatabase
   Set collection = db.AllDocuments
   
   Set doc = collection.GetFirstDocument
   
   While Not (doc Is Nothing)
      Call doc.ComputeWithForm(True,False)
      Call doc.Save(True,False)
      Set doc = collection.GetNextDocument(doc)
   Wend
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: Rob Green am 26.05.03 - 15:00:26
Vorsicht, das compute with form berechnet leider in den Docs berechnete Werte nicht neu. Dazu muß man wirklich toolsrefreshselected nehmen, also ein @command.

Oder aber das o.g. Script so umstricken, das es berechnete Werte selbst ausrechnet und neu ablegt.
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: eknori am 26.05.03 - 15:13:25
wie wäre es denn mit @Command([ToolsRefreshSelectedDocs]); ??
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: Axel am 26.05.03 - 15:46:44
Hi,

so was hab ich vor kurzem erst gebraucht.

Hier ist das Teil:

Zitat
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim workspace As New NotesUIWorkspace


Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument
   
While Not (doc Is Nothing)
  Set uidoc = workspace.EditDocument( True, doc)
  Call uidoc.Save
  Call uidoc.Close
      
  Set doc = collection.GetNextDocument(doc)
Wend  'While Not (doc Is Nothing)


Pack den Code in einen Agenten und setze die Option "Für ausgewählte Dokumente".

Axel

Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: harkpabst_meliantrop am 26.05.03 - 15:49:12
Jepp! Diesen Agenten (unter anderem) packe ich (mit ner Entwicklerrolle vor Missbrauch geschützt) erstmal in jede neue Datenbank, wenn ich ein Projekt anfange. Extrem praktisch.

edit:
Ups, wieder mal zu lange das Fenster aufgehabt. Bezog sich ebenfalls auf Eknoris Posting ...
Titel: Re:Agent - öffnen und wieder speichern
Beitrag von: Gandalf am 26.05.03 - 16:10:34
Thx @all
Enknoris weg war für mich der einfachere
da ich ein Scriptdau bin
werd es aber auch ohne Zeitdruck mal an der Datenbank testen

Bye
gandalf
DerjetztinRuheFeierabendmachenkann :-)