Domino 9 und frühere Versionen > Entwicklung

Antwortdokumente - Hauptdokumente

<< < (2/3) > >>

TMC:
Prima klasse, klappt ja wunderbar!

NotesDocumentCollection.StampAll ist cool, da brauchts nicht mal mehr ein Save  8)

cu,
TMC

TMC:
Hab ja ganz vergessen, noch das Script zu posten, soll ja auch anderen hilfreich sein:


--- Zitat ---Sub Querysave(Source As Notesuidocument, Continue As Variant)
'#################################################################   
'# Zweck: Werte werden beim Speichern in alle AW-Doks übernommen   
'#################################################################
   
   'ui-Zeug
   Dim uiws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Set uidoc = uiws.CurrentDocument
   'backend-Zeug
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim dc As NotesDocumentCollection
   Dim doc As NotesDocument
   Set db = session.CurrentDatabase
   
   'Wenn UIDoc neu ist: dann verlasse Script
   If uidoc.IsNewDoc Then
      Exit Sub
   Else
      Continue = True
   End If   
   
     'uidoc zu backend-doc   
   Set doc = uidoc.Document
   'alle Antwortdocs des Backend-Docs werden in die Collection aufgenommen
   Set dc = doc.Responses
   'Radikal-Methode: setze alle Felder der Collection, gespeichert wird automatisch   
   Call dc.StampAll( "Re_Status" , doc.Status(0) )
   Call dc.StampAll( "Re_No" , doc.No(0) )
   Call dc.StampAll( "Re_Type" , doc.Type(0) )
   
End Sub
--- Ende Zitat ---

TMC

Semeaphoros:
Folgenden Teil kannst Du Dir sparen:

else
  continue=true

Bei allen Events ist continue=true vorbesetzt.

TMC:
aha, danke für die Info, Semeaphoros!

Ist wohl aus Gewohnheit, ich setze das eigentlich immer in solchen Situationen.

Und wieder was gelernt.

TMC

Semeaphoros:
Fein.

Bei den Schleifen hab ich schon mal geschrieben, dass ich die Exit nicht so besonders schätze, und so würde ich den ganzen If-Block etwa so fassen:

If Not Source.IsNewDoc Then

.....

End If


Der Effizienzgewinn, der sich dadurch wahrscheinlich ergibt, ist aber wohl nicht einmal messbar.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln