Hi All
I am trying to create a LotusScript function on the PostSave Event, which calls a Function CAlled Managers. This is used to send an email to the appropriate person.
What I have is a form with some fields, one of the fields is Department. Depending on what department is chosen,a mail will be sent to a certain manager who owns that department.
I have a profile form called SageProfile with two fields, IT and Accounts, each has a different name, so depending on what is chosen in the user form it will look up the SageProfile and pick the correct manager to send the email to. I have a snippet of the following code:-
Dim managers As NotesItem
If doc.GetItemValue( "Department" ) = "IT" Then
Set managers = SageProfile.GetFirstItem( "IT" )
Elseif doc.GetItemValue( "Department" ) = "Accounts" Then
Set managers = SageProfile.GetFirstItem( "Accounts" )
End If
If( managers Is Nothing ) Then Exit Sub
'Create new memo
Dim memo As New NotesDocument( db )
memo.SendTo = managers.Values
I get the following error
“Variant does not contain an object”
Sorry but I have never programmed in LotusScript so I am not really to sure what I am doing.
Regards
Douglas Bell