Hi all,
I’m stumped and I don’t know how to fix my issue. So let me explain. I have a agent in LS which runs to dispatch tickets. During the dispatching it will generate an email to the requester…This part works. If the requester opened a ticket for multiple users, during the filling out of the form from the requester they put all the user’s name in the form. This is captured by field RefUsers.
When the script runs if the RefUser is populated then it will generate an email and send it everyone listed.
The issue is I cannot get the email to send to all listed in the field. Only the first person is captured. I tried this a tester form and it worked. I have a feeling that it’s because this agent is running as a class, where everything is Me.
Here is the coding for the email portion for RefUsers:
Now the recipients string has declared at the beginning of the script. The declaration was:
Dim recipients( 1 To 5 ) As String
'RefUser is checked and tallyed to include all users.
Dim getdata As Variant
Dim n
getdata = Me.m_ardoc.RefUser
Forall gd In getdata
n = n + 1
recipients(n) = gd
End Forall
'configuring fields on email doc
sendDoc.CopyTo = Me.m_ardoc.AssignedTo_1(0)
sendDoc.Person = recipients
sendDoc.Subject = “Technical Request has been recieved”
sendDoc.HDTicket = Me.m_ardoc.HDTicket
sendDoc.OrgTech = Me.m_ardoc.AssignedTo_1
sendDoc.ProblemCat = Me.m_ardoc.ProblemCat
sendDoc.ProblemSubCat = Me.m_ardoc.ProblemSubCat
sendDoc.Form = “NotifyEmail”
Set RichTextItem = New NotesRichTextItem(sendDoc,“Body”)
Call RichTextItem.AppendText(“Link to your Request”)
Call RichTextItem.AddnewLine(1)
Call RichTextItem.AddnewLine(1)
Call RichTextItem.AppendDocLink (Me.m_ardoc, “Link to your Request”)
Call sendDoc.Send(True)
Hope you can provide assistance or guide me what I should be doing…
Thanks in advance!