I need to have “FormA” prompt the user for a customer name, and have the name be saved in “FormB”. I was thinking of using @SetField, but this command appears to only work with the current open form. What is the best method to prompt a user for input, but have the data be saved to another Form?
Subject: Form update trick
Hi
I work more better with LS, this is a code, I hope it help you:
Dim Sesion As New NotesSession
Set db= Sesion.currentdatabase
Set view = db.GetView( “SSM” )
llave = Inputbox(“Document Key”)
Set doc = view.GetDocumentByKey( llave )
If doc Is Nothing Then
'If doesn´t exist, I create the doc.
Set newdoc = db.CreateDocument
With newdoc
.ReplaceItemValue "Form", "SSM" 'Assing Form name
.ReplaceItemValue "Key", llave 'Replace field value...
.Save True, True
End With
Else
'If exist, update doc
With doc
.ReplaceItemValue "Key", llave 'Replace field value...
.Save True, True
End With
End if
'Note: SSM View is sorting by Key field.