Florin M.
Florin M.

Reputation: 2169

Lotus Notes: refresh form from field

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!

Upvotes: 2

Views: 2845

Answers (2)

Tode
Tode

Reputation: 12060

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

Upvotes: 3

mhd196
mhd196

Reputation: 21

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.

Upvotes: 1

Related Questions