bobdraz
asked on
Listtag error in Forall
I get the "LISTTAG argument not a list element" error in the following Forall. doc.fldEmplReqs is a multivalue checkbox that dos populate the variable "newEmplItems" successfully. I need to extract each value into the varible "apr".
Function newEmplApproval(doc As NotesDocument) As Variant
Dim newEmplItems As Variant
Dim newEmplkey As String
Dim apr As String
Dim aprname As String
Dim BS As String, LS As String, DLTS As String, SS As String
Dim num As String
newEmplItems = doc.fldEmplReqs
Forall x In newEmplItems
apr = Listtag(x)
If apr <> "" Then
num= assignNumber(doc)
aprname = getProfile(apr)
SS = "Action Required: Ticket # " & num
BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
Call sendMail(BS,LS,DLTS,SS,apr name,doc)
End If
End Forall
End Function
Function newEmplApproval(doc As NotesDocument) As Variant
Dim newEmplItems As Variant
Dim newEmplkey As String
Dim apr As String
Dim aprname As String
Dim BS As String, LS As String, DLTS As String, SS As String
Dim num As String
newEmplItems = doc.fldEmplReqs
Forall x In newEmplItems
apr = Listtag(x)
If apr <> "" Then
num= assignNumber(doc)
aprname = getProfile(apr)
SS = "Action Required: Ticket # " & num
BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
Call sendMail(BS,LS,DLTS,SS,apr
End If
End Forall
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I resolved the error "Not a sub or function:APR". Your code worked fine. Thank you very much. Your time and efforts are appriciated.
Bob
Bob
ASKER
Function newEmplApproval(doc As NotesDocument) As Variant
Dim newEmplItems As Variant
Dim newEmplkey As String
Dim apr As String
Dim aprname As String
Dim BS As String, LS As String, DLTS As String, SS As String
Dim num As String
Dim k As Integer
newEmplItems = doc.fldEmplReqs
k=0
Forall x In newEmplItems
Redim Preserve apr(k) As String
If x <> "" Then
apr(k) = x
k = k + 1
aprname = getProfile(x)
num= assignNumber(doc)
SS = "Action Required: Ticket # " & num
BS = "A ticket has been opened that requires your approval." & Chr(10) & Chr(10) & "All relevant information is included in the request."
Call sendMail(BS,LS,DLTS,SS,apr
End If
End Forall
End Function