Hi all,
I have two forms.
Form A has two fields which uses @picklist for the users to select user addresses to send to. There is also a save button.
On form B i have a couple of embedded views, an action button with some lotusscript to send and email and two fields. Now these two frields ‘Approver1’ and ‘Approver2’ are both computed and inherit the values from form A.
The only problem is that the users have to go to form A and click on the action button to open form b in order to inherit the values and for the mail script to work.
Ideally i would like it so that the users dont have to open form B up by going to form a so can anyone help me with my code and get it to work.
If i open form B up and try to send the email nothing happens because the values are not being inherited.
this is the lotusscript code i am using:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Dim bodyRTF As NotesRichTextItem
Dim emailMsg As New notesdocument(session.CurrentDatabase)
Set emailMsg = New NotesDocument(session.CurrentDatabase)
If Trim(uidoc.FieldGetText("Approver1")) <> "" Then
emailmsg.sendTo = uidoc.FieldGetText("Approver1")
emailmsg.subject = "FYI: Checklist Completion"
Set bodyRTF = emailMsg.CreateRichTextItem("Body")
Call bodyRTF.AddNewline(1)
Call bodyRTF.AppendText("Hi,")
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendText("This email has been sent on the basis that the following checklist tasks are complete.")
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendText("Please follow the link for details regarding the completed checklist...")
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendDocLink(uidoc.Document, "Please follow the link for details regarding the completed checklist")
Call uidoc.save
Call emailMsg.Send(False)
Else
Msgbox("ERORR: SendTo field is blank and therefore cannot send mail.")
End If
End Sub
Despite the address saved and stored in the fields on form A…if i go straight to form b and try to send the mail my msg box appears due to the values not inheriting…
is there away round this to make it possible.
Im not great at writing code so any help would seriously be appreciated.
Thank you so much