2
votes

I have an editable field. Another computed field value depends from the value of the editable field.

In the Exiting event of the editable field I add:

    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Set uidoc = workspace.CurrentDocument
    Call uidoc.Refresh

But it still not works. If I check the form property Automatically refresh fields, it goes OK, but the form performance decreases, it is very slow.

Any suggestions? Thanks!

2
"still not works" is not a sufficient error message. I use this code sometimes and usually it DOES work. Did you use debugger to check, if the code is triggered? What is the formula in your computed field? Is is below the editable field or above it?Torsten Link
Thanks for your reply! The computed field is above the editable field.Florin M.
Notes ALWAYS computes from Left to Right and Top to Buttom... That means: If the computed field is ABOVE the editable, you need to refresh TWICE.Torsten Link
Amazing! Would you post it as an answer?Florin M.

2 Answers

3
votes

Lotus Notes always computes the whole form from left to right and from top to bottom. If a computed field is above the field, that triggers the refresh, then it does not have access to the "new" values of the editable field on the first refresh.

You would need 2x Call uidoc.refresh to make the computed field reflect the changes.

Or you move the computed field BELOW the editable field, then one single refresh will be sufficient.

Alternatively you may choose to use the onBlur- Event instead of the exiting- event as the "on"- Events were meant to replace the "Classic" Field events since version 6 of Lotus Domino / Notes. Check this link to Designer Help to see hints like
The corresponding LotusScript-only events still occur, but their continued use in Release 6 applications is discouraged.
onBlur: New for LotusScript with Release 6 and
Exiting: Preferred is onBlur

1
votes

in the editable field's event "OnBlur" , switch to Client/LotusScript) and only add :

notesuiuiworkspace.CurrentDocument.Refresh

Don't forget to remove the one in exiting.