Uidoc.reload seems not to work

Hi ls experts,

i also try to reload (refresh) the uidocument with changes from the backend doc - made from this uidoc.

But “nothing” happens…

Code looks like this (it is on the onchange event of another field, not the date field which should be transmitted):

Sub Onchange(Source As Field)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

'MB_Hotelbuchung is the field, on which this onchange event is:

If doc.MB_Hotelbuchung(0) = "yes" Then

doc.datefield2 = doc.datefield1

Else

doc.datefield2 = ""		



End If

'now I try to show the changes in the uidoc:

Call uidoc.Reload

End Sub

as I said, no changes are visible… unless I press the F9 button: Then of course datefield2 is filled with the new (or empty) value.

Am I missing anything?

Thanks in advance

Uwe

Subject: uidoc.reload seems not to work

I believe you need both:

UIDoc.Reload

UIDoc.Refresh

Subject: RE: uidoc.reload seems not to work

i already tried: doesn’t make any difference.

Even added .computewithform - without result

Uwe

Subject: RE: uidoc.reload seems not to work

Have you put in a Messagebox statement to make sure your Onchange code is executing at all?

If the field with the onchange event is a keyword field, you might instead use the option “Refresh on keyword change” and use input translation formula to change the value of the date field. If it’s not a keyword field, the Onchange event will also not work.

Subject: uidoc.reload seems not to work

Try using the doc.Save method.

Also, you should not have to use the uidoc.reload method as the uidoc.AutoReload is automagically set to True when you instantiate a NotesDocument using the Document property of the NotesUIDocument: the two become intimately aware of changes to each other.

Subject: RE: uidoc.reload seems not to work

so when .AutoReload is automatically True - do you have any clue why I can’t see any changes in the front end? Only F9 shows them!

And do I really have to save the doc? Maybe the user won’t save it?!

Uwe

Subject: RE: uidoc.reload seems not to work

doc.Save was just a last resort.Is the uidoc in editmode?

Try setting uidoc.EditMode=True.