Domino 9 und frühere Versionen > ND6: Entwicklung
Refresh fields in Script
Axel:
Andreas, bist du dir da sicher?
Ich war der gleichen Meinung wie Bernhard. Und in einigen Fällen konnte ich schon beobachten, dass eben nicht alle Formeln berechnet wurden.
Ich bin der Ansicht, dass man ComputeWithForm nach wie vor mit Vorsicht genießen sollte.
Axel
Glombi:
--- Zitat von: Axel am 15.03.06 - 19:06:41 ---Andreas, bist du dir da sicher?
Ich war der gleichen Meinung wie Bernhard. Und in einigen Fällen konnte ich schon beobachten, dass eben nicht alle Formeln berechnet wurden.
Ich bin der Ansicht, dass man ComputeWithForm nach wie vor mit Vorsicht genießen sollte.
Axel
--- Ende Zitat ---
Na, ich bin sicher.
Selbst Änderungen des Feldtypen werden nachgezogen. Ich denke, IBM hat ab V6 einiges an der Funktion optimiert, denn früher war das zugegebenermaßen nicht so stabil.
Also bis heute habe ich keine negativen Erfahren gemacht (oder diese verdrängt ;-) )
Andreas
koehlerbv:
--- Zitat ---Falls bspw. ein neues Autorfeld (Berechnet beim Anlagen) mit der Formel @Username zur Maske hinzugefügt wird, wird mittels ComputeWithForm dieses Item sogar mit der Property AUTHOR erstellt.
--- Ende Zitat ---
DAS funktioniert, Andreas. Ist ja auch ein neues Feld (was hier wegen CopyAllItems eher nicht ansteht, aber wer weiss ...).
Versuche einfach mal nur, ein neues Appointment-Doc in einem Mail-File zu erzeugen und mit ComputeWithForm wirklich alle Items nachberechnen zu lassen. Viel Vergnügen, kann ich da nur sagen ;D Gerade ab R6! Die Items, die dabei vorab belegt sein müssen (bzw. sollten), sind dann auch noch zwischen den einzelnen Releases unterschiedlich - ComputeWithForm läuft immer erst ab anderen Stellen ohne Gemecker durch.
Du kennst ja mein herangehen an solche Probleme: Bei aller Systematik bleibt ComputeWithForm nur für allereinfachste Fälle brauchbar. Es tut auf jeden Fall nicht das, was ein F9 im Frontend "von oben nach unten" ausführen würde.
Fazit: Ich verwende ComputeWithForm gar nicht mehr: Sind die Masken einfach, kann ich es auch selber machen. Sind sie kompliziert, muss ich immer mit dem Wasserstand des Chiemsees oder der Lunation rechnen ...
Bernhard
PS: Mit all doc.ComputeWithForm (False, False) bekommst Du ja noch nicht einmal eine Rückmeldung, ob das Ganze funktioniert hat ...
Glombi:
Mal sehen, was die KBASE so an Issues liefert:
ComputeWithForm does not set the Summary flag for text fields over 15KB
Product:
Lotus Notes > Lotus Notes > Versions 6.0, 6.5
Platform(s):
Platform Independent
Doc Number:
1090219
When using the LotusScript ComputeWithForm method (of the NotesDocument class), the Summary flag is not set as expected with Text fields of certain sizes. It is not set in cases where the size of the field is greater than 15KB and less than the Notes Domino 6.0 maximum of 32KB. If the field is less than 15KB, calling the method works as expected.
Glombi:
LotusScript Agent to Recalculate Documents on a Schedule
Product:
Lotus Notes > Lotus Notes > Versions 6.0, 5.0, 4.6, 4.5, 6.5
Platform(s):
Platform Independent
Doc Number:
1099014
Published 27.08.2004
Technote
Problem
How can you have documents recalculate in the background so that computed fields are up to date and accurate? For example, a database has documents that do @DbLookups, @DbColumns, etc. to other documents that are occasionally updated with new information. If a document is opened, @Db formulas will not recalculate until you press F9; therefore, the data may not be accurate.
Solution
The following script can be run as a scheduled agent to 'tickle' and save documents on the back end. The method that is actually doing the recalc is the ComputeWithForm method of the NotesDocument class. This method will recalculate @Db formulas only when run on Notes 4.5a (and above) clients and servers.
Note: If a form contains a Computed field (for example, a field called "Count") with a formula which is based on its own field value (for example, "Count+1"), then the ComputeWithForm method is not suitable for use in refreshing that document. This is because the ComputeWithForm method triggers recalculation twice. For more information on this topic see the related document, "Is it Possible to Refresh Documents Using LotusScript ?" (#1092630).
IMPORTANT NOTE: The following is a sample script, provided only to illustrate one way to approach this issue. Notes Support will not be able to customize this script for a customer's own configuration.
Sub Initialize
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
Do Until doc is Nothing
Call doc.ComputeWithForm(False,False)
Call doc.save(False,False)
Set doc=collection.GetNextDocument( doc )
Loop
Related Documents:
Is it Possible to Refresh Documents Using LotusScript ?
Document #: 1092630 (176609)
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln