Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Dim WarningMessage As String
Dim YesOrNo As Integer
If uidoc.FieldGetText( "Z_Status" ) = "Handout has been declined by " And uidoc.FieldGetText( "CMRemarks" ) = "" Then
Messagebox( "*** You have to provide a reason for Declination ***" ), 0 + 16
Call uidoc.GotoField( "CMRemarks" )
Continue = False
Exit Sub
End If
Call uidoc.Save
Dim doc As NotesDocument
Dim item As NotesItem
Dim user As String
user = session.UserName
Set item=doc.ReplaceItemValue( "From",user)
Und da steigt mir das script mit diesem Fehler aus. Sprich - die eigentlich Frage ist nach wie vor - wie kann ich im Lotus Script einem Feld den Wert eines anderen Feldes zuweisen. Bzw, kann man im Script ähnlich wie indet Formularlanguage temporäre Felder erzeugen um Werte zwischenzuspeichern ...
Also so sieht das script aus bis zu dem Wert wo der Fehler kommt -
und da requested - hier der ganze Code:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Dim WarningMessage As String
Dim YesOrNo As Integer
If uidoc.FieldGetText( "Z_Status" ) = "Handout has been declined by " And uidoc.FieldGetText( "CMRemarks" ) = "" Then
Messagebox( "*** You have to provide a reason for Declination ***" ), 0 + 16
Call uidoc.GotoField( "CMRemarks" )
Continue = False
Exit Sub
End If
Call uidoc.Save
Dim doc As NotesDocument
Dim item As NotesItem
Dim user As String
user = session.UserName
Set item=doc.ReplaceItemValue( "From",user)
Set item=doc.ReplaceItemValue( "SendTo","Principal")
Set item=doc.ReplaceItemValue( "Principal","")
Set item=doc.ReplaceItemValue( "Subject","Z_Status1")
Call uidoc.Refresh
Call uidoc.Send
Set item=doc.ReplaceItemValue( "From","OFrom")
Set item=doc.ReplaceItemValue( "SendTo","OSendTo")
Set item=doc.ReplaceItemValue( "Principal","OPrincipal")
Set item=doc.ReplaceItemValue( "Subject","OSubject")
Set item=doc.ReplaceItemValue( "SaveOptions",0)
Call uidoc.Refresh
Call uidoc.save
Call uidoc.close(True)
End Sub