Formula to Script

Ok, I know this is so simple but I only know formula… so, how do I write this in script for use under “OnChange” action…

FIELD CopyTo := @UserName

The default script is:

Sub Onchange(Source As Field)

Dim workspace As New NotesUIWorkspace

Call workspace.ViewRefresh

End Sub

How would this script change?

Thanks so much, Paul

Subject: Code

Sub Onchange(Source As Field)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Call uidoc.FieldSetText(“CopyTo”,session.CommonUsername)

Call workspace.ViewRefresh

End Sub

Subject: Super, thanks!!!

Hi Karl-Henry

That is so nice, thank you!

I actually needed the long name so figured out I just had to delete the “Common” part.

Take care, Paul