Is it Possible to Refresh Documents Using LotusScript ?
Interesting little tidbit from the Knowledgebase...
Is it Possible to Refresh Documents Using LotusScript ?
Document Number:
1092630
Problem
Is there a LotusScript function equivalent
to the following @Formula functions:
@Command[ToolsRefreshAllDocs]
@Command[ToolsRefreshSelectedDocs])
The ComputeWithForm method (of the NotesDocument
class) does not recalculate fields.
Content
In most cases, the ComputeWithForm method
(of the NotesDocument class) can be used to refresh documents. This
method is actually designed to trigger a field's Default Value, Input Translation
and Input Validation formulas, but it also does trigger Computed formulas
as well.
The ComputeWithForm method is not suitable
for refreshing forms which have a Computed field which refers to itself.
This is because the ComputeWithForm method recalculates the document
twice, which would cause undesirable results in such a field formula.
For example, consider a form with a
Computed Numeric field called Count, and the formula for this field is
"Count+1". If the Count field had a value of 1 before the
ComputeWithForm method was called, then afterwards the Count field would
have a resulting value of 3.
For cases where a field's formula references
itself, there are two ways to workaround this limitation:
- Refresh the document using either @Command[ToolsRefreshSelectedDocs] or @Command[ToolsRefreshAllDocs].
- Perform the formula calculation for the field in the LotusScript agent itself.
For example, to increment a Numeric field named Count:
doc.count=doc.count(0)+1
Call doc.save(True, True)



Comments
Posted by Duffbert At 07:53:04 On 18/02/2004 | - Website - |
if the person doc's http password has any value in it, we move on to the next doc. when we find a blank http password, we go out via odbc to a sql server database pull in the first 6 digits of the user's password, and populate the http password field with that.
problem being, the password would be left as clear text, ie, no hash applied. computewithform didn't help.
instead of banging my head forerver on it, we just went with a refresh all docs agent as a follow up to the password agent.
Posted by marcus At 07:20:20 On 18/02/2004 | - Website - |
Posted by null At 03:50:12 On 26/03/2009 | - Website - |