Solved

Listtag error in Forall

Posted on 2004-08-19
3
324 Views
Last Modified: 2013-12-18
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,aprname,doc)      
            End If
            
      End Forall      
      
End Function
0
Comment
Question by:bobdraz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 11841779
wrong use of listtag...

Use array to store values

eg:
k=0
   Forall x In newEmplItems
redim preserve apr(k) as string
          If x <> "" Then
               apr(k) = x
               k = k + 1
               num= assignNumber(doc)
               aprname = getProfile(x)
               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,aprname,doc)    
          End If
         
     End Forall    

~Hemanth
0
 

Author Comment

by:bobdraz
ID: 11841950
My changed code follows, but now I get the error "Not a sub or function: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
      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,aprname,doc)      
            End If
            
      End Forall      
      
End Function
0
 

Author Comment

by:bobdraz
ID: 11842586
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
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question